FIX: Cannot Deserialize from HTTP1.1 Server / Java Servlets

ID: Q187904

The information in this article applies to:

SYMPTOMS

When reading a serialized object from a Java servlet that is running on an HTTP 1.1 Web server the following exception is seen:

   java.io.StreamCorruptedException: InputStream does not contain a
   serialized object

CAUSE

Certain Web Servers, notably Apache and Lotus Go Domino are HTTP 1.1 aware meaning that they will respond to requests from HTTP 1.1 capable browsers with data in the HTTP 1.1 protocol format. When serialized objects are passed from a Java servlet running on the relevant server, those objects are passed in what is known as "chunked" format (similar to how MIME encodes embedded objects). A bug in the Microsoft products listed prevents our Virtual Machine for Java from being able to deserialize those objects properly.

RESOLUTION

Since the Web server communicates with the browser in a LCD fashion, the user may set the browser to not use HTTP 1.1 (from the IE4 View menu, select Internet Options and click the Advanced tab) by simply clearing the check box labeled "Use HTTP 1.1." This causes the server to not send data in the "chunked" format and the Virtual Machine for Java is able to interpret and deserialize objects sent from Java servlets running on the server properly.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug has been corrected in the Virtual Machine for Java distributed with Internet Explorer 4.01 Service Pack 1 and later.

MORE INFORMATION

Servlets are Java objects that run on Web Servers via a CGI-like mechanism.

REFERENCES

For more information on the HTTP 1.1 specification and "chunked" format, please see the request for comments (RFC):

   http://www.cis.ohio-state.edu/htbin/rfc/rfc2068.html

For more information on Java servlets, please see the White Paper: "The Java Servlet API" at the Javasoft site:

   http://www.javasoft.com/marketing/collateral/servlets.html

Additional query words: servlet chunked
Version           : WINDOWS:3.02,4.0,4.01
Platform          : WINDOWS
Issue type        : kbbug
Solution Type     : kbfix

Last Reviewed: June 22, 1998