Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4634165

REGRESSION: Exceptions serialized in 1.4beta3 unserializable by jdk 1.1.x

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P3 P3
    • None
    • 1.4.0
    • core-libs



      Name: gm110360 Date: 02/06/2002


      FULL PRODUCT VERSION :
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta3-b84)
      Java HotSpot(TM) Client VM (build 1.4.0-beta3-b84, mixed mode)

      FULL OPERATING SYSTEM VERSION :
      Microsoft Windows 2000 [Version 5.00.2195]



      A DESCRIPTION OF THE PROBLEM :
      Exceptions and subclasses (and possibly Throwable
      subclasses - haven't tested) serialized in 1.4 (Tomcat 3.2
      server) can not be deserialized using jdk 1.1 (Internet
      Explorer client).


      REGRESSION. Last worked in version 1.3.1

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Write a servlet that serializes an Exception (or
      subclass) to the response outputstream.
      2. Write an applet that reads the object.
      3. Run the servlet and serve the applet on Tomcat 3.2 (will
      probably work on any server running in 1.4 though)
      4. Connect to the servlet using the applet in a 1.1 client
      (i.e. Internet Explorer)

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      Surely Exceptions should be serializable between different
      VMs, as they were before 1.4?

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      java.lang.ClassNotFoundException
      at java/io/ObjectInputStream.loadClass0 (ObjectInputStream.java)
      at java/io/ObjectInputStream.resolveClass (ObjectInputStream.java:852)
      at java/io/ObjectInputStream.readClassDescriptor
      (ObjectInputStream.java:1165)
      at java/io/ObjectInputStream.readArray (ObjectInputStream.java:1100)
      at java/io/ObjectInputStream.checkSpecialCases
      (ObjectInputStream.java:1063)
      at java/io/ObjectInputStream.readObject (ObjectInputStream.java:300)
      at java/io/ObjectStreamClass.doMismatchedRead (ObjectStreamClass.java)
      at java/io/ObjectInputStream.defaultReadObject
      (ObjectInputStream.java:448)
      at java/io/ObjectInputStream.readNewObject (ObjectInputStream.java:1296)
      at java/io/ObjectInputStream.readObject (ObjectInputStream.java:309)

      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      A test applet:

      import java.io.*;
      import java.net.*;
      public class TestApplet extends java.applet.Applet {

          public void init () {
              try
              {
                  URL url = new URL(getCodeBase()+"servlet/TestServlet");
                  URLConnection urlConn = url.openConnection();
                  ObjectInputStream ois =
                      new ObjectInputStream(urlConn.getInputStream());
                  Object obj = ois.readObject();
              }
              catch(Exception e)
              {
                  e.printStackTrace();
              }
          }
      }

      and a test servlet:

      import javax.servlet.*;
      import javax.servlet.http.*;
      public class TestServlet extends HttpServlet {

          protected void processRequest(HttpServletRequest request,
      HttpServletResponse response)
          throws ServletException, java.io.IOException {
              java.io.ObjectOutputStream out =
                  new java.io.ObjectOutputStream(response.getOutputStream());
              out.writeObject(new Exception("Test Exception"));
              out.close();
          }

          protected void doGet(HttpServletRequest request, HttpServletResponse
      response)
          throws ServletException, java.io.IOException {
              processRequest(request, response);
          }

          protected void doPost(HttpServletRequest request, HttpServletResponse
      response)
          throws ServletException, java.io.IOException {
              processRequest(request, response);
          }
      }

      ---------- END SOURCE ----------

      Release Regression From : merlin-beta3
      The above release value was the last known release where this
      bug was known to work. Since then there has been a regression.

      Release Regression From : merlin-beta3
      The above release value was the last known release where this
      bug was known to work. Since then there has been a regression.

      (Review ID: 138558)
      ======================================================================

            mwarressunw Michael Warres (Inactive)
            gmanwanisunw Girish Manwani (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: