1 2 3 Previous Next 70 Replies Latest reply on Apr 20, 2006 3:38 PM by clebert.suconic

    Problem with Lazy attributes - 4.0.3SP1-EJB3.0RC4

    phon

      hello,

      when i try to load an entity that has non initialized entites i get the following exception on the client. this does not happen when i initialize the attributes in the session bean before sending the entity to the client. this also didn't happen using 4.0.3RC2+EJB3.0RC3. anyone has any idea ?

      [12:16:42,015] [ERROR] [SocketClientInvoker:274] - Got marshalling exception, exiting
      java.lang.ClassCastException: cannot assign instance of org.hibernate.proxy.SerializableProxy to field be.profitplus.entities.contact.CommercieelContact.aankoopAfspraken of type be.profitplus.entities.contact.AankoopAfspraken in instance of be.profitplus.entities.contact.CommercieelContact
       at java.io.ObjectStreamClass$FieldReflector.setObjFieldValues(ObjectStreamClass.java:1977)
       at java.io.ObjectStreamClass.setObjFieldValues(ObjectStreamClass.java:1157)
       at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1918)
       at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1836)
       at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
       at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
       at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
       at java.util.ArrayList.readObject(ArrayList.java:592)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:919)
       at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1813)
       at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
       at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
       at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
       at org.jboss.aop.joinpoint.InvocationResponse.readExternal(InvocationResponse.java:107)
       at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1753)
       at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1711)
       at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
       at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1912)
       at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1836)
       at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
       at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
       at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
       at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.receiveObject(JavaSerializationManager.java:128)
       at org.jboss.remoting.marshal.serializable.SerializableUnMarshaller.read(SerializableUnMarshaller.java:66)
       at org.jboss.remoting.transport.socket.SocketClientInvoker.transport(SocketClientInvoker.java:260)
       at org.jboss.remoting.RemoteClientInvoker.invoke(RemoteClientInvoker.java:131)
       at org.jboss.remoting.Client.invoke(Client.java:258)
       at org.jboss.remoting.Client.invoke(Client.java:221)
       at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:55)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:55)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:65)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.ejb3.stateful.StatefulRemoteProxy.invoke(StatefulRemoteProxy.java:133)
       at $Proxy3.getCommercieelContacten(Unknown Source)
       at be.profitplus.client.businessdelegates.CommercialContactManagerBD.getContacts(CommercialContactManagerBD.java:72)
       at be.profitplus.client.gui.components.datasource.CommercialContactDataSource.getCollection(CommercialContactDataSource.java:13)
       at be.profitplus.client.gui.components.prototypes.PPSPPPrototype.objectSearched(PPSPPPrototype.java:205)
       at be.profitplus.client.gui.components.prototypes.PPSPPPrototype$1.actionPerformed(PPSPPPrototype.java:102)
       at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
       at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
       at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
       at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
       at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
       at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231)
       at java.awt.Component.processMouseEvent(Component.java:5488)
       at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
       at java.awt.Component.processEvent(Component.java:5253)
       at java.awt.Container.processEvent(Container.java:1966)
       at java.awt.Component.dispatchEventImpl(Component.java:3955)
       at java.awt.Container.dispatchEventImpl(Container.java:2024)
       at java.awt.Component.dispatchEvent(Component.java:3803)
       at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
       at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
       at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
       at java.awt.Container.dispatchEventImpl(Container.java:2010)
       at java.awt.Window.dispatchEventImpl(Window.java:1774)
       at java.awt.Component.dispatchEvent(Component.java:3803)
       at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
       at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
       at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
       at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:153)
       at java.awt.Dialog$1.run(Dialog.java:515)
       at java.awt.Dialog.show(Dialog.java:536)
       at java.awt.Component.show(Component.java:1300)
       at java.awt.Component.setVisible(Component.java:1253)
       at be.profitplus.client.gui.components.prototypes.PPManagementPrototype.openSearchWindow(PPManagementPrototype.java:321)
       at be.profitplus.client.gui.components.prototypes.PPManagementPrototype.processCode(PPManagementPrototype.java:273)
       at be.profitplus.client.gui.components.prototypes.PPManagementPrototype$1.keyPressed(PPManagementPrototype.java:107)
       at java.awt.Component.processKeyEvent(Component.java:5446)
       at javax.swing.JComponent.processKeyEvent(JComponent.java:2713)
       at java.awt.Component.processEvent(Component.java:5265)
       at java.awt.Container.processEvent(Container.java:1966)
       at java.awt.Component.dispatchEventImpl(Component.java:3955)
       at java.awt.Container.dispatchEventImpl(Container.java:2024)
       at java.awt.Component.dispatchEvent(Component.java:3803)
       at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1810)
       at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:672)
       at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:920)
       at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:798)
       at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:636)
       at java.awt.Component.dispatchEventImpl(Component.java:3841)
       at java.awt.Container.dispatchEventImpl(Container.java:2024)
       at java.awt.Window.dispatchEventImpl(Window.java:1774)
       at java.awt.Component.dispatchEvent(Component.java:3803)
       at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
       at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
       at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
       at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
       at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
       at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
      Exception occurred during event dispatching:
      java.lang.reflect.UndeclaredThrowableException
       at $Proxy3.getCommercieelContacten(Unknown Source)
       at be.profitplus.client.businessdelegates.CommercialContactManagerBD.getContacts(CommercialContactManagerBD.java:72)
       at be.profitplus.client.gui.components.datasource.CommercialContactDataSource.getCollection(CommercialContactDataSource.java:13)
       at be.profitplus.client.gui.components.prototypes.PPSPPPrototype.objectSearched(PPSPPPrototype.java:205)
       at be.profitplus.client.gui.components.prototypes.PPSPPPrototype$1.actionPerformed(PPSPPPrototype.java:102)
       at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
       at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
       at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
       at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
       at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
       at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231)
       at java.awt.Component.processMouseEvent(Component.java:5488)
       at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
       at java.awt.Component.processEvent(Component.java:5253)
       at java.awt.Container.processEvent(Container.java:1966)
       at java.awt.Component.dispatchEventImpl(Component.java:3955)
       at java.awt.Container.dispatchEventImpl(Container.java:2024)
       at java.awt.Component.dispatchEvent(Component.java:3803)
       at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
       at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
       at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
       at java.awt.Container.dispatchEventImpl(Container.java:2010)
       at java.awt.Window.dispatchEventImpl(Window.java:1774)
       at java.awt.Component.dispatchEvent(Component.java:3803)
       at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
       at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
       at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
       at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:153)
       at java.awt.Dialog$1.run(Dialog.java:515)
       at java.awt.Dialog.show(Dialog.java:536)
       at java.awt.Component.show(Component.java:1300)
       at java.awt.Component.setVisible(Component.java:1253)
       at be.profitplus.client.gui.components.prototypes.PPManagementPrototype.openSearchWindow(PPManagementPrototype.java:321)
       at be.profitplus.client.gui.components.prototypes.PPManagementPrototype.processCode(PPManagementPrototype.java:273)
       at be.profitplus.client.gui.components.prototypes.PPManagementPrototype$1.keyPressed(PPManagementPrototype.java:107)
       at java.awt.Component.processKeyEvent(Component.java:5446)
       at javax.swing.JComponent.processKeyEvent(JComponent.java:2713)
       at java.awt.Component.processEvent(Component.java:5265)
       at java.awt.Container.processEvent(Container.java:1966)
       at java.awt.Component.dispatchEventImpl(Component.java:3955)
       at java.awt.Container.dispatchEventImpl(Container.java:2024)
       at java.awt.Component.dispatchEvent(Component.java:3803)
       at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1810)
       at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:672)
       at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:920)
       at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:798)
       at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:636)
       at java.awt.Component.dispatchEventImpl(Component.java:3841)
       at java.awt.Container.dispatchEventImpl(Container.java:2024)
       at java.awt.Window.dispatchEventImpl(Window.java:1774)
       at java.awt.Component.dispatchEvent(Component.java:3803)
       at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
       at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
       at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
       at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
       at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
       at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
      Caused by: java.rmi.MarshalException: Failed to communicate. Problem during marshalling/unmarshalling; nested exception is:
       java.lang.ClassCastException: cannot assign instance of org.hibernate.proxy.SerializableProxy to field be.profitplus.entities.contact.CommercieelContact.aankoopAfspraken of type be.profitplus.entities.contact.AankoopAfspraken in instance of be.profitplus.entities.contact.CommercieelContact
       at org.jboss.remoting.transport.socket.SocketClientInvoker.transport(SocketClientInvoker.java:287)
       at org.jboss.remoting.RemoteClientInvoker.invoke(RemoteClientInvoker.java:131)
       at org.jboss.remoting.Client.invoke(Client.java:258)
       at org.jboss.remoting.Client.invoke(Client.java:221)
       at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:55)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:55)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:65)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.ejb3.stateful.StatefulRemoteProxy.invoke(StatefulRemoteProxy.java:133)
       ... 57 more
      Caused by: java.lang.ClassCastException: cannot assign instance of org.hibernate.proxy.SerializableProxy to field be.profitplus.entities.contact.CommercieelContact.aankoopAfspraken of type be.profitplus.entities.contact.AankoopAfspraken in instance of be.profitplus.entities.contact.CommercieelContact
       at java.io.ObjectStreamClass$FieldReflector.setObjFieldValues(ObjectStreamClass.java:1977)
       at java.io.ObjectStreamClass.setObjFieldValues(ObjectStreamClass.java:1157)
       at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1918)
       at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1836)
       at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
       at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
       at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
       at java.util.ArrayList.readObject(ArrayList.java:592)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:919)
       at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1813)
       at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
       at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
       at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
       at org.jboss.aop.joinpoint.InvocationResponse.readExternal(InvocationResponse.java:107)
       at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1753)
       at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1711)
       at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
       at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1912)
       at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1836)
       at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713)
       at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
       at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
       at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.receiveObject(JavaSerializationManager.java:128)
       at org.jboss.remoting.marshal.serializable.SerializableUnMarshaller.read(SerializableUnMarshaller.java:66)
       at org.jboss.remoting.transport.socket.SocketClientInvoker.transport(SocketClientInvoker.java:260)
       ... 69 more
      


        • 1. Re: Problem with Lazy attributes - 4.0.3SP1-EJB3.0RC4
          elkner
          • 2. Re: Problem with Lazy attributes - 4.0.3SP1-EJB3.0RC4
            phon

            thank you for the reply.

            but the problem they refer to in the post you mentioned is when SerializableProxy cannot be found. in my case it can be found (hibernate3.jar is in de classpath) but i get a classcast exception when i try to lazily initialize a entity relation with it (which worked under RC3)..

            i also made sure that server and client were using the exact same hibernate3.jar ..

            any ideas ?

            • 3. Re: Problem with Lazy attributes - 4.0.3SP1-EJB3.0RC4

              Same problem here: lazily initialized entity bean fields can not be marshalled because of this! The problem is still present in RC5.

              • 4. Re: Problem with Lazy attributes - 4.0.3SP1-EJB3.0RC4
                phon

                hi, glad to see i'm not the only one with a similar problem. could you let me know when you find a solution ? I will post it here too if I should find it.

                about the problem, a similar problem also surfaced when moving from RC3 to RC4, but this time it's in the server thread. It seems that a SerializationException is thrown when the server tries to passivate a stateful session bean. Again this worked fine with RC3.

                This is the exception:

                03:56:17,872 ERROR [SimpleStatefulCache] problem passivation thread
                javax.ejb.EJBException: Could not passivate; failed to save state
                 at org.jboss.ejb3.cache.simple.StatefulSessionFilePersistenceManager.passivateSession(StatefulSessionFilePersistenceManager.java:354)
                 at org.jboss.ejb3.cache.simple.SimpleStatefulCache.passivate(SimpleStatefulCache.java:191)
                 at org.jboss.ejb3.cache.simple.SimpleStatefulCache$SessionTimeoutTask.run(SimpleStatefulCache.java:127)
                Caused by: org.jboss.serial.exception.SerializationException
                 at org.jboss.serial.persister.PrivateWritePersister.writeData(PrivateWritePersister.java:83)
                 at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:117)
                 at org.jboss.serial.objectmetamodel.DataContainer$DataContainerOutput.writeObject(DataContainer.java:260)
                 at org.jboss.serial.persister.ArrayPersister.saveObjectArray(ArrayPersister.java:96)
                 at org.jboss.serial.persister.ArrayPersister.writeData(ArrayPersister.java:87)
                 at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:117)
                 at org.jboss.serial.objectmetamodel.DataContainer$DataContainerOutput.writeObject(DataContainer.java:260)
                 at org.jboss.serial.io.JBossObjectOutputStream.writeObjectOverride(JBossObjectOutputStream.java:111)
                 at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:287)
                 at org.jboss.serial.io.MarshalledObject.<init>(MarshalledObject.java:51)
                 at org.jboss.ejb3.stateful.StatefulBeanContext.writeExternal(StatefulBeanContext.java:368)
                 at org.jboss.serial.persister.ExternalizePersister.writeData(ExternalizePersister.java:45)
                 at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:117)
                 at org.jboss.serial.objectmetamodel.DataContainer$DataContainerOutput.writeObject(DataContainer.java:260)
                 at org.jboss.serial.io.JBossObjectOutputStream.writeObjectOverride(JBossObjectOutputStream.java:111)
                 at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:287)
                 at org.jboss.ejb3.cache.simple.StatefulSessionFilePersistenceManager.passivateSession(StatefulSessionFilePersistenceManager.java:342)
                 ... 2 more
                Caused by: java.lang.reflect.InvocationTargetException
                 at sun.reflect.GeneratedMethodAccessor112.invoke(Unknown Source)
                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                 at java.lang.reflect.Method.invoke(Method.java:585)
                 at org.jboss.serial.persister.PrivateWritePersister.writeData(PrivateWritePersister.java:73)
                 ... 18 more
                Caused by: org.jboss.serial.exception.SerializationException
                 at org.jboss.serial.persister.PrivateWritePersister.writeData(PrivateWritePersister.java:83)
                 at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:117)
                 at org.jboss.serial.objectmetamodel.DataContainer$DataContainerOutput.writeObject(DataContainer.java:260)
                 at org.jboss.serial.persister.ObjectOutputStreamProxy.writeObjectOverride(ObjectOutputStreamProxy.java:45)
                 at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:287)
                 at java.util.HashMap.writeObject(HashMap.java:985)
                 ... 22 more
                Caused by: java.lang.reflect.InvocationTargetException
                 at sun.reflect.GeneratedMethodAccessor114.invoke(Unknown Source)
                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                 at java.lang.reflect.Method.invoke(Method.java:585)
                 at org.jboss.serial.persister.PrivateWritePersister.writeData(PrivateWritePersister.java:73)
                 ... 27 more
                Caused by: org.jboss.serial.exception.SerializationException
                 at org.jboss.serial.persister.PrivateWritePersister.writeData(PrivateWritePersister.java:83)
                 at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:117)
                 at org.jboss.serial.objectmetamodel.DataContainer$DataContainerOutput.writeObject(DataContainer.java:260)
                 at org.jboss.serial.persister.RegularObjectPersister.defaultWrite(RegularObjectPersister.java:81)
                 at org.jboss.serial.persister.ObjectOutputStreamProxy.writeFields(ObjectOutputStreamProxy.java:63)
                 at org.jboss.serial.persister.ObjectOutputStreamProxy.defaultWriteObject(ObjectOutputStreamProxy.java:53)
                 at org.hibernate.ejb.AbstractEntityManagerImpl.writeObject(AbstractEntityManagerImpl.java:292)
                 ... 31 more
                Caused by: java.lang.reflect.InvocationTargetException
                 at sun.reflect.GeneratedMethodAccessor115.invoke(Unknown Source)
                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                 at java.lang.reflect.Method.invoke(Method.java:585)
                 at org.jboss.serial.persister.PrivateWritePersister.writeData(PrivateWritePersister.java:73)
                Caused by: org.jboss.serial.exception.SerializationException
                 at org.jboss.serial.persister.PrivateWritePersister.writeData(PrivateWritePersister.java:83)
                 at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:117)
                 at org.jboss.serial.objectmetamodel.DataContainer$DataContainerOutput.writeObject(DataContainer.java:260)
                 at org.jboss.serial.persister.RegularObjectPersister.defaultWrite(RegularObjectPersister.java:81)
                 at org.jboss.serial.persister.ObjectOutputStreamProxy.writeFields(ObjectOutputStreamProxy.java:63)
                 at org.jboss.serial.persister.ObjectOutputStreamProxy.defaultWriteObject(ObjectOutputStreamProxy.java:53)
                 at org.hibernate.impl.SessionImpl.writeObject(SessionImpl.java:199)
                 ... 41 more
                Caused by: java.lang.reflect.InvocationTargetException
                 at sun.reflect.GeneratedMethodAccessor119.invoke(Unknown Source)
                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                 at java.lang.reflect.Method.invoke(Method.java:585)
                 at org.jboss.serial.persister.PrivateWritePersister.writeData(PrivateWritePersister.java:73)
                 ... 47 more
                Caused by: org.jboss.serial.exception.SerializationException
                 at org.jboss.serial.persister.PrivateWritePersister.writeData(PrivateWritePersister.java:83)
                 at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:117)
                 at org.jboss.serial.objectmetamodel.DataContainer$DataContainerOutput.writeObject(DataContainer.java:260)
                 at org.jboss.serial.persister.RegularObjectPersister.defaultWrite(RegularObjectPersister.java:81)
                 at org.jboss.serial.persister.ObjectOutputStreamProxy.writeFields(ObjectOutputStreamProxy.java:63)
                 at org.jboss.serial.persister.ObjectOutputStreamProxy.defaultWriteObject(ObjectOutputStreamProxy.java:53)
                 at org.hibernate.engine.StatefulPersistenceContext.writeObject(StatefulPersistenceContext.java:237)
                 ... 51 more
                Caused by: java.lang.reflect.InvocationTargetException
                 at sun.reflect.GeneratedMethodAccessor112.invoke(Unknown Source)
                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                 at java.lang.reflect.Method.invoke(Method.java:585)
                 at org.jboss.serial.persister.PrivateWritePersister.writeData(PrivateWritePersister.java:73)
                 ... 57 more
                Caused by: java.lang.ClassCastException: [Ljava.lang.Class;
                 at org.jboss.serial.persister.ClassReferencePersister.writeData(ClassReferencePersister.java:42)
                 at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:117)
                 at org.jboss.serial.objectmetamodel.DataContainer$DataContainerOutput.writeObject(DataContainer.java:260)
                 at org.jboss.serial.persister.RegularObjectPersister.defaultWrite(RegularObjectPersister.java:81)
                 at org.jboss.serial.persister.RegularObjectPersister.writeData(RegularObjectPersister.java:46)
                 at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:117)
                 at org.jboss.serial.objectmetamodel.DataContainer$DataContainerOutput.writeObject(DataContainer.java:260)
                 at org.jboss.serial.persister.RegularObjectPersister.defaultWrite(RegularObjectPersister.java:81)
                 at org.jboss.serial.persister.RegularObjectPersister.writeData(RegularObjectPersister.java:46)
                 at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:117)
                 at org.jboss.serial.objectmetamodel.DataContainer$DataContainerOutput.writeObject(DataContainer.java:260)
                 at org.jboss.serial.persister.RegularObjectPersister.defaultWrite(RegularObjectPersister.java:81)
                 at org.jboss.serial.persister.RegularObjectPersister.writeData(RegularObjectPersister.java:46)
                 at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:117)
                 at org.jboss.serial.objectmetamodel.DataContainer$DataContainerOutput.writeObject(DataContainer.java:260)
                 at org.jboss.serial.persister.ObjectOutputStreamProxy.writeObjectOverride(ObjectOutputStreamProxy.java:45)
                 at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:287)
                 at java.util.HashMap.writeObject(HashMap.java:985)
                 ... 61 more
                


                • 5. Re: Problem with Lazy attributes - 4.0.3SP1-EJB3.0RC4

                  Same problem also with AS 4.0.4RC1

                  • 6. Re: Problem with Lazy attributes - 4.0.3SP1-EJB3.0RC4
                    phon

                    i'm not really familiar with JIRA, but would this be a problem to open a JIRA issue for ?

                    • 7. Re: Problem with Lazy attributes - 4.0.3SP1-EJB3.0RC4

                      ANYBODY EXPERIENCING THIS BUG please speak up NOW!

                      I am surprised nobody else has noticed this as it must be very obvious in any system. Either nobody has upgraded to RC5 yet or there is nobody using EJB3 with a real-world datamodel :-)

                      I can not think of any configuration badness which could cause this problem. And there is nothing in the FAQ or release notes either. To me it looks like a bug in remoting and thus should go into JIRA. I can do that if you like. But given that JBoss developers rather have discussions in the forums than immediate bug reports I thought to wait a little and give them a chance to make a statement.

                      • 8. Re: Problem with Lazy attributes - 4.0.3SP1-EJB3.0RC4
                        phon

                        i'm experiencing the strangest thing here..
                        i develop my ejb3 client with Eclipse, and for testing purposes i package it into a Java Web Start so for the testers to download..

                        this bug does not occur in the webstart! very very strange as it uses exactly the same libs as i use in my Eclipse (i just copy the lib dir actually) ..
                        i also checked eclipse and java webstart are using the same jdk

                        this confuses me even more ..

                        • 9. Re: Problem with Lazy attributes - 4.0.3SP1-EJB3.0RC4

                          That's very interesting! So it seems to depend on the runtime environment. I am seeing this bug when I run JUnit test from within Eclipse that are clients to a locally running JBoss instance. My JUnit tests are using required libraries directly from the JBoss installation directory.

                          What is your use case exactly, phon? Are you accessing JBoss from an application client?

                          • 10. Re: Problem with Lazy attributes - 4.0.3SP1-EJB3.0RC4
                            phon

                            i got a JBoss Server (4.0.3SP1) running on a linux machine and i connect to it from another machine (my development machine) through eclipse with a swing client , and the testers connect to it through VPN with java webstart
                            when i'm at work i connect through local LAN, when at home i connect the same way the testers do, over VPN. It doesn't seem to matter wether i'm using the LAN or the VPN.

                            i'm tracing the cause of this problem and i noticed that this doesn't happen for every object. i got a database filled with 1500 generated contacts for testing purposes. When using my client from inside Eclipse certain queries work just fine, other generate the exception.. all queries work fine from webstart though!

                            • 11. Re: Problem with Lazy attributes - 4.0.3SP1-EJB3.0RC4
                              phon

                              i got a JBoss Server (4.0.3SP1) running on a linux machine and i connect to it from another machine (my development machine) through eclipse with a swing client , and the testers connect to it through VPN with java webstart
                              when i'm at work i connect through local LAN, when at home i connect the same way the testers do, over VPN. It doesn't seem to matter wether i'm using the LAN or the VPN.

                              i'm tracing the cause of this problem and i noticed that this doesn't happen for every object. i got a database filled with 1500 generated contacts for testing purposes. When using my client from inside Eclipse certain queries work just fine, other generate the exception.. all queries work fine from webstart though!

                              • 12. Re: Problem with Lazy attributes - 4.0.3SP1-EJB3.0RC4
                                andrewtv

                                I have also experienced this -- seems like jboss serialization cannot handle the uninitialized lazy attributes (ClassCastException in ClassReferencePersister.java:42). In my case I can work around it for the time being by using a local interface on the same machine, but I can see how this is an issue for remote interfaces. It would probably be nice if they get serialized but just omit the lazy stuff, and the your coding contracts understand this.

                                • 13. Re: Problem with Lazy attributes - 4.0.3SP1-EJB3.0RC4
                                  phon

                                  you are talking about the exception happening on the server i assume ? i don't really know wether the two exceptions are related.

                                  i got (only beginning line of exception):

                                  1) On client when loading entity lazy (after sending them over network)

                                  java.lang.ClassCastException: cannot assign instance of org.hibernate.proxy.SerializableProxy to field be.profitplus.entities.contact.CommercieelContact.aankoopAfspraken of type be.profitplus.entities.contact.AankoopAfspraken in instance of be.profitplus.entities.contact.CommercieelContact
                                  at java.io.ObjectStreamClass$FieldReflector.setObjFieldValues(Unknown Source)

                                  2) On server when the AS tries to passivate my SFSB

                                  10:32:23,317 ERROR [SimpleStatefulCache] problem passivation thread
                                  javax.ejb.EJBException: Could not passivate; failed to save state
                                  at org.jboss.ejb3.cache.simple.StatefulSessionFilePersistenceManager.passivateSession(StatefulSessionFilePersistenceManager.java:354)
                                  at org.jboss.ejb3.cache.simple.SimpleStatefulCache.passivate(SimpleStatefulCache.java:191)
                                  at org.jboss.ejb3.cache.simple.SimpleStatefulCache$SessionTimeoutTask.run(SimpleStatefulCache.java:127)
                                  Caused by: org.jboss.serial.exception.SerializationException

                                  are you both experiencing both problems ? or are they one and the same problem ?

                                  • 14. Re: Problem with Lazy attributes - 4.0.3SP1-EJB3.0RC4
                                    andrewtv

                                    I believe the jboss serialization is related to your #2 case (you'll see it stems from the ClassCaseException in ClassReferencePersister). It looks like someone filed a bug on it:

                                    EJBTHREE-423

                                    Andrew

                                    1 2 3 Previous Next