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

Interoperability issue marshalling class with member type "Serializable" between IBM & Oracle ORB

XMLWordPrintable

    • generic
    • generic

      SYNOPSIS
      --------
      Interoperability issue when marshalling a class with a member of type "Serializable" between IBM and Oracle ORB


      OPERATING SYSTEM
      ----------------
      All (tested on Windows and Linux)


      FULL JDK VERSION(S)
      -------------------
      All


      PROBLEM DESCRIPTION
      -------------------
      The interoperability issue is seen between the Oracle and IBM JDKs in the following scenario:

      1. The remote object has a serializable member
      2. Different class versions are present on the client and server side, which results in a meta call

      A marshall exception is always thrown by the client side (irrespective of whether its IBM/Oracle JDK) trying the read the response of the meta call. Here is an example Exception from the Oracle JDK acting as the client (and IBM JDK as the server):

      17-Aug-2012 12:22:59 com.sun.corba.se.impl.encoding.CDRInputStream_1_0 read_value
      WARNING: "IOP00810211: (MARSHAL) Exception from readValue on ValueHandler in CDRInputStream"
      org.omg.CORBA.MARSHAL: vmcid: SUN minor code: 211 completed: Maybe
              at com.sun.corba.se.impl.logging.ORBUtilSystemException.valuehandlerReadException(ORBUtilSystemException.java:7004)
              at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1045)
              at com.sun.corba.se.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:253)
              at _TestService_Stub.getTest(_TestService_Stub.java:38)
              at TestClient.main(TestClient.java:24)
      Caused by: java.io.StreamCorruptedException: Unknown kind: 21
              at com.sun.corba.se.impl.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:2375)
              at com.sun.corba.se.impl.io.IIOPInputStream.inputObjectUsingFVD(IIOPInputStream.java:1565)
              at com.sun.corba.se.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:397)
              at com.sun.corba.se.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:317)
              at com.sun.corba.se.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:283)
              at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1034)
              ... 3 more
      Caused by: java.io.StreamCorruptedException: Unknown kind: 21
              at com.sun.corba.se.impl.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:2359)
              ... 8 more
      java.rmi.MarshalException: CORBA MARSHAL 1398079699 Maybe; nested exception is:
              org.omg.CORBA.MARSHAL: vmcid: SUN minor code: 211 completed: Maybe
              at com.sun.corba.se.impl.javax.rmi.CORBA.Util.mapSystemException(Util.java:197)
              at javax.rmi.CORBA.Util.mapSystemException(Util.java:67)
              at _TestService_Stub.getTest(_TestService_Stub.java:47)
              at TestClient.main(TestClient.java:24)
      Caused by: org.omg.CORBA.MARSHAL: vmcid: SUN minor code: 211 completed: Maybe
              at com.sun.corba.se.impl.logging.ORBUtilSystemException.valuehandlerReadException(ORBUtilSystemException.java:7004)
              at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1045)
              at com.sun.corba.se.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:253)
              at _TestService_Stub.getTest(_TestService_Stub.java:38)
              ... 1 more
      Caused by: java.io.StreamCorruptedException: Unknown kind: 21
              at com.sun.corba.se.impl.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:2375)
              at com.sun.corba.se.impl.io.IIOPInputStream.inputObjectUsingFVD(IIOPInputStream.java:1565)
              at com.sun.corba.se.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:397)
              at com.sun.corba.se.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:317)
              at com.sun.corba.se.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:283)
              at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1034)
              ... 3 more
      Caused by: java.io.StreamCorruptedException: Unknown kind: 21
              at com.sun.corba.se.impl.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:2359)
              ... 8 more

      The IBM JDK is able to detect that the client's Partner Version is Oracle and thereby marshals the Serializable member as an ANY, but the Oracle JDK marshals the Serializable Member as an Interface, which results in the failure. A similar problem happens when the IBM/Oracle JDKs roles are reversed (the Oracle JDK marshals the member as an Interface, but the IBM JDK expects an ANY).

      According to page 29 of "OMG Java to IDL Language Mapping Specification" v1.4 ( http://www.omg.org/spec/JAV2I/1.4/PDF ):

      ------------------------------------------------------------------------
      4.3.10.1 java.io.Serializable and java.io.Externalizable

      As a special case, any uses of java.io.Serializable or java.io.Externalizable as a parameter, result, or field are mapped to the OMG IDL types ::java::io::Serializable and ::java::io::Externalizable respectively.

      These OMG IDL types are defined as follows:

      // IDL
      module java {
      module io {
          typedef any Serializable;
          typedef any Externalizable;
      };
      };
      ------------------------------------------------------------------------


      REPRODUCTION INSTRUCTIONS
      -------------------------
      1. Extract the attached test package
      2. cd to testcase's "server" folder
      3. Set PATH to IBM JDK *
      4. Run: tnameserv -ORBInitialPort 2809
      5. Open a new terminal window and cd to testcase's "server" folder
      6. Run: java TestServer
      7. Open a new terminal window and cd to testcase's "client" folder
      8. Set PATH to Oracle JDK *
      9. Run: java TestClient

      * Or vice versa

      No Exception is seen when communicating from Oracle JDK to Oracle JDK, or from IBM JDK to IBM JDK


      SUGGESTED FIX
      -------------
      Marshall the Serializable member as an ANY, instead of interface.

            Unassigned Unassigned
            dkorbel David Korbel (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: