1 Reply Latest reply: Apr 29, 2011 8:53 PM by EJP RSS

    Any reason for: StreamCorruptedException: invalid stream header: 0A0A0A0A?

      Servlet code:
           ServletOutputStream sos = res.getOutputStream();
           ObjectOutputStream oos = new ObjectOutputStream(sos);
      Applet code:
      InputStream is = (InputStream)urlConn.getInputStream();
      BufferedInputStream bis = new BufferedInputStream(is);
      ObjectInputStream in = new ObjectInputStream(bis);//This line fails

      The error happens after the above line of code. Users with proxy are getting this error. Does proxy timeout? any idea why it is happening to some customer users with proxy? In very few cases users without any proxy server get the error.

      Edited by: user7286037 on Apr 29, 2011 2:36 PM
        • 1. Re: Any reason for: StreamCorruptedException: invalid stream header: 0A0A0A0A?
          The proxy is obviously corrupting the data. 0x0a0a0a0a is four LF bytes, not that that suggests anything much.

          I suspect that the customers who say they don't have a proxy actually do, maybe an invisible one. Or maybe you have an incoming proxy somewhere on your side. Check that all proxies anywhere are commercial grade, not hand written. We've seen here many times that programmers have the most extraordinary ideas about how to write proxy servers.

          I assume your real code writes objects, not just primitive data? Otherise you could use DataInputStream and DataOutputStream. Wouldn't fix the problem, just change it, but it would be more space-efficient over the wire.