OpenJPA
  1. OpenJPA
  2. OPENJPA-559

java.rmi.MarshalException due to mismatched serialization UIDs of: Source (RepId RMI:org.apache.openjpa.kernel.DetachedStateManager

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.3, 1.1.0
    • Fix Version/s: 1.0.3, 1.1.0
    • Component/s: kernel
    • Labels:
      None

      Description

      When a JSE client requests JPA function via components in an application server, in some combination of client/server operating environment, the client request failed with the following exception even if the client and server are using the same level of OpenJPA code:

      java.rmi.MarshalException. Error Message is:CORBA MARSHAL 0x4942f896 No; nested exception is:
      org.omg.CORBA.MARSHAL: Unable to read value from underlying bridge : Mismatched
      serialization UIDs : Source (RepId RMI:org.apache.openjpa.kernel.DetachedStateManager
      :C7D15E4B35987A3F:766FF0A32408BC7A) = 766FF0A32408BC7A whereas Target (RepId
      RMI:org.apache.openjpa.kernel.DetachedStateManager:47697E6CFD3BF01F:548BD6248B0927C4)
      = 548BD6248B0927C4

      One of the test environment combination that we have observed this exception is a Win32 client and a SunOS application server configuration. The client uses IBM JDK and SunOS uses Sun JDK.

      From the JavaDoc Serializable class:

      "If a serializable class does not explicitly declare a serialVersionUID, then the serialization runtime will calculate a default serialVersionUID value for that class based on various aspects of the class, as described in the Java(TM) Object Serialization Specification. However, it is strongly recommended that all serializable classes explicitly declare serialVersionUID values, since the default serialVersionUID computation is highly sensitive to class details that may vary depending on compiler implementations, and can thus result in unexpected InvalidClassExceptions during deserialization. Therefore, to guarantee a consistent serialVersionUID value across different java compiler implementations, a serializable class must declare an explicit serialVersionUID value. It is also strongly advised that explicit serialVersionUID declarations use the private modifier where possible, since such declarations apply only to the immediately declaring class--serialVersionUID fields are not useful as inherited members."

      Adding the following in DetachedStateManager resolved the problem.

      private static final long serialVersionUID = 6092198373388527556L;

      Albert Lee.

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        22m 8s 1 Albert Lee 04/Apr/08 20:48
        Resolved Resolved Closed Closed
        10d 22h 24m 1 Albert Lee 15/Apr/08 19:13
        Albert Lee made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Albert Lee made changes -
        Field Original Value New Value
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Albert Lee created issue -

          People

          • Assignee:
            Albert Lee
            Reporter:
            Albert Lee
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development