0

I am working with Glassfish 3.1.2.2, eclipse-link as JPA provider and Java JDK-6u31. My application is 3-tiered with a stand-alone Swing client running on its own JVM on the client machines. Communication with EJBs by JNDI lookups and @Remote interfaces.

I have the following object inheritance structure:

My super class "Document" :

@Entity
@Table(name = "Document")
@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)
public class Document implements IUpdateableEntity {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE)
    private Long id;

    @Basic(optional=false, fetch=FetchType.LAZY)
    @Lob
    private byte[] content;

    @Transient
    private transient File file;

    public Document() { }

    // getters and setters ...

}

... and a sub class "Invoice" :

@Entity
@Table(name = "Dokument")
public class Invoice extends Document implements IUpdateableEntity {

    private static final long serialVersionUID = 1L;

    // some additional relations and attributes ...

    public Invoice () { }

    // getters and setters ...

}

Now I get this exception while calling my ejb facade in order to persist the invoice object (calling persist(), flush(), refresh() and return the object to the client in order to supply the client with auto-generated ID) :

29.11.2012 20:21:25 com.sun.corba.ee.spi.orbutil.logex.WrapperGenerator handleFullLogging
WARNUNG: IOP00810011: Exception from readValue on ValueHandler in CDRInputStream
org.omg.CORBA.MARSHAL: WARNUNG: IOP00810011: Exception from readValue on ValueHandler in CDRInputStream  vmcid: OMG  minor code: 11 completed: Maybe

I've already combed through the internet and found hints that point to a serialVersionUID problem since CORBA marshalling clearly fails in this example.

Then I turned on my debugger in Netbeans IDE and introspected the state of the object before it is sent to the server side ejb bean.

I realized that there is a duplicate serialVersionUID when opening the Static Fields node in the debugger window (compare with the following image) :

enter image description here

- Somebody any clue how to solve this issue ?

I have other inheritance structures like this in my project that are very similar constructed (without @Lob) and I don't have this problem there... May the @Lob field raise this behaviour somehow?

Any help highly appreciated & thank you in advance!

EDIT: Here's the full stack trace:

29.11.2012 20:21:25 com.sun.corba.ee.spi.orbutil.logex.WrapperGenerator handleFullLogging
WARNUNG: IOP00810011: Exception from readValue on ValueHandler in CDRInputStream
org.omg.CORBA.MARSHAL: WARNUNG: IOP00810011: Exception from readValue on ValueHandler in CDRInputStream  vmcid: OMG  minor code: 11 completed: Maybe
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at com.sun.corba.ee.spi.orbutil.logex.corba.CorbaExtension.makeException(CorbaExtension.java:248)
    at com.sun.corba.ee.spi.orbutil.logex.corba.CorbaExtension.makeException(CorbaExtension.java:95)
    at com.sun.corba.ee.spi.orbutil.logex.WrapperGenerator.handleFullLogging(WrapperGenerator.java:387)
    at com.sun.corba.ee.spi.orbutil.logex.WrapperGenerator.access$400(WrapperGenerator.java:107)
    at com.sun.corba.ee.spi.orbutil.logex.WrapperGenerator$2.invoke(WrapperGenerator.java:511)
    at com.sun.corba.ee.spi.orbutil.proxy.CompositeInvocationHandlerImpl.invoke(CompositeInvocationHandlerImpl.java:99)
    at $Proxy24.valuehandlerReadException(Unknown Source)
    at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.readRMIIIOPValueType(CDRInputStream_1_0.java:1022)
    at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1123)
    at com.sun.corba.ee.impl.encoding.CDRInputObject.read_value(CDRInputObject.java:531)
    at com.sun.corba.ee.impl.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:2162)
    at com.sun.corba.ee.impl.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:2404)
    at com.sun.corba.ee.impl.io.IIOPInputStream.inputObject(IIOPInputStream.java:1224)
    at com.sun.corba.ee.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:425)
    at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:308)
    at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:274)
    at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.readRMIIIOPValueType(CDRInputStream_1_0.java:1015)
    at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1123)
    at com.sun.corba.ee.impl.encoding.CDRInputObject.read_value(CDRInputObject.java:531)
    at com.sun.corba.ee.impl.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:2162)
    at com.sun.corba.ee.impl.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:2404)
    at com.sun.corba.ee.impl.io.IIOPInputStream.inputObject(IIOPInputStream.java:1224)
    at com.sun.corba.ee.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:425)
    at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:308)
    at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:274)
    at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.readRMIIIOPValueType(CDRInputStream_1_0.java:1015)
    at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1123)
    at com.sun.corba.ee.impl.encoding.CDRInputObject.read_value(CDRInputObject.java:531)
    at com.sun.corba.ee.impl.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:2162)
    at com.sun.corba.ee.impl.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:2404)
    at com.sun.corba.ee.impl.io.IIOPInputStream.inputObject(IIOPInputStream.java:1224)
    at com.sun.corba.ee.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:425)
    at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:308)
    at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:274)
    at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.readRMIIIOPValueType(CDRInputStream_1_0.java:1015)
    at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1123)
    at com.sun.corba.ee.impl.encoding.CDRInputObject.read_value(CDRInputObject.java:531)
    at com.sun.corba.ee.impl.presentation.rmi.ExceptionHandlerImpl$ExceptionRWRMIImpl.read(ExceptionHandlerImpl.java:180)
    at com.sun.corba.ee.impl.presentation.rmi.ExceptionHandlerImpl.readException(ExceptionHandlerImpl.java:290)
    at com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl.readException(DynamicMethodMarshallerImpl.java:502)
    at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.privateInvoke(StubInvocationHandlerImpl.java:205)
    at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:152)
    at com.sun.corba.ee.impl.presentation.rmi.codegen.CodegenStubBase.invoke(CodegenStubBase.java:227)
    at ch.lawsuite.control.__DokumentFacadeRemote_Remote_DynamicStub.create(ch/lawsuite/control/__DokumentFacadeRemote_Remote_DynamicStub.java)
    at ch.lawsuite.control._DokumentFacadeRemote_Wrapper.create(ch/lawsuite/control/_DokumentFacadeRemote_Wrapper.java)
    at ch.lawsuite.gui.misc.unterlagen.ModDocumentUI.btnSpeichernActionPerformed(ModDocumentUI.java:631)
    at ch.lawsuite.gui.misc.unterlagen.ModDocumentUI.access$300(ModDocumentUI.java:52)
    at ch.lawsuite.gui.misc.unterlagen.ModDocumentUI$6.actionPerformed(ModDocumentUI.java:384)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
    at java.awt.Component.processMouseEvent(Component.java:6290)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
    at java.awt.Component.processEvent(Component.java:6055)
    at java.awt.Container.processEvent(Container.java:2039)
    at java.awt.Component.dispatchEventImpl(Component.java:4653)
    at java.awt.Container.dispatchEventImpl(Container.java:2097)
    at java.awt.Component.dispatchEvent(Component.java:4481)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4575)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4236)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4166)
    at java.awt.Container.dispatchEventImpl(Container.java:2083)
    at java.awt.Window.dispatchEventImpl(Window.java:2482)
    at java.awt.Component.dispatchEvent(Component.java:4481)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:648)
    at java.awt.EventQueue.access$000(EventQueue.java:84)
    at java.awt.EventQueue$1.run(EventQueue.java:607)
    at java.awt.EventQueue$1.run(EventQueue.java:605)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
    at java.awt.EventQueue$2.run(EventQueue.java:621)
    at java.awt.EventQueue$2.run(EventQueue.java:619)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:618)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:178)
    at java.awt.Dialog$1.run(Dialog.java:1044)
    at java.awt.Dialog$3.run(Dialog.java:1096)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.awt.Dialog.show(Dialog.java:1094)
    at java.awt.Component.show(Component.java:1584)
    at java.awt.Component.setVisible(Component.java:1536)
    at java.awt.Window.setVisible(Window.java:841)
    at java.awt.Dialog.setVisible(Dialog.java:984)
    at ch.lawsuite.gui.misc.unterlagen.ModDocumentUI.showFrame(ModDocumentUI.java:118)
    at ch.lawsuite.gui.dateneinheit.akte.AkteUI.btnImportFestplatteActionPerformed(AkteUI.java:5877)
    at ch.lawsuite.gui.dateneinheit.akte.AkteUI.access$3300(AkteUI.java:75)
    at ch.lawsuite.gui.dateneinheit.akte.AkteUI$126.actionPerformed(AkteUI.java:4170)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
    at java.awt.Component.processMouseEvent(Component.java:6290)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
    at java.awt.Component.processEvent(Component.java:6055)
    at java.awt.Container.processEvent(Container.java:2039)
    at java.awt.Component.dispatchEventImpl(Component.java:4653)
    at java.awt.Container.dispatchEventImpl(Container.java:2097)
    at java.awt.Component.dispatchEvent(Component.java:4481)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4575)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4236)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4166)
    at java.awt.Container.dispatchEventImpl(Container.java:2083)
    at java.awt.Window.dispatchEventImpl(Window.java:2482)
    at java.awt.Component.dispatchEvent(Component.java:4481)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:648)
    at java.awt.EventQueue.access$000(EventQueue.java:84)
    at java.awt.EventQueue$1.run(EventQueue.java:607)
    at java.awt.EventQueue$1.run(EventQueue.java:605)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
    at java.awt.EventQueue$2.run(EventQueue.java:621)
    at java.awt.EventQueue$2.run(EventQueue.java:619)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:618)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: java.lang.NullPointerException
    at com.sun.corba.ee.impl.orbutil.ClassInfoCache$ClassInfo.<init>(ClassInfoCache.java:156)
    at com.sun.corba.ee.impl.orbutil.ClassInfoCache.get(ClassInfoCache.java:281)
    at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1097)
    at com.sun.corba.ee.impl.encoding.CDRInputObject.read_value(CDRInputObject.java:531)
    at com.sun.corba.ee.impl.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:2162)
    at com.sun.corba.ee.impl.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:2404)
    at com.sun.corba.ee.impl.io.IIOPInputStream.inputObject(IIOPInputStream.java:1224)
    at com.sun.corba.ee.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:425)
    at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:308)
    at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:274)
    at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.readRMIIIOPValueType(CDRInputStream_1_0.java:1015)
    ... 121 more
salocinx
  • 3,715
  • 8
  • 61
  • 110
  • 2
    Having two serialVersionUIDs is expected in this case - it's declared in the base class, and then again in the subclass - which is normal and recommended - see the last paragraph at http://docs.oracle.com/javase/6/docs/api/java/io/Serializable.html Given that, I doubt that the serialVersionUID field is the cause of your problem. Is there any more detail from the stack trace? – GreyBeardedGeek Nov 29 '12 at 19:56
  • CORBA makes no use of serialVersionUIDs. Your problem is elsewhere. – user207421 Nov 29 '12 at 20:39
  • @EJB: I forget to mention that I have a 3-tiered setup with a stand-alone client running in its own JVM. Communication is through JNDI (IIORB) and remote interfaces. Are you sure serialVersionUIDs are not used for serialization? – salocinx Nov 29 '12 at 22:36
  • @GreyBeardedGeek: I have another, similar inheritance structure in my design, but there, the objects features only one UID. I appended a more detailed stack trace to the question above. Thanks for your help! – salocinx Nov 29 '12 at 22:39
  • @salocinx: well, that tells us that it's a NullPointerException while trying to de-serialize the object. Unfortunately, it doesn't indicate anything about what was null, or why. More than this is almost impossible to diagnose without 'being there'. – GreyBeardedGeek Nov 29 '12 at 22:57
  • @salonix Yes, I am sure that serialVersionUIDs are not used for serialization *by CORBA,* which is what you are using: see the stack trace. – user207421 Nov 30 '12 at 00:19
  • @Steven Schlansker: WARNUNG==WARNING, this is german, I'm living in the german part of Switzerland ;-) – salocinx Nov 30 '12 at 10:21
  • @EJP: okay thanks for the valuable information. – salocinx Nov 30 '12 at 10:22

1 Answers1

1

static fields belong to the class. You have an instance of an Invoice, which is both an Invoice and a Document. So there are two static fields named serialVersionUID that are relevant, Document.serialVersionUID and Invoice.serialVersionUID. In normal use, you will only see the top one, since the superclass's is masked. Doubly so because they are private and so access by subclasses is forbidden. The debugger is not subject to visibility rules and is apparently showing you both.

This seems to be normal, and absent of any other evidence, is likely not the cause of your problem.

You could double check this by changing one of the values to be distinct (e.g. 2) and then you should see the distinct values in the debugger more clearly.

Steven Schlansker
  • 37,580
  • 14
  • 81
  • 100