3 Replies Latest reply on Jul 12, 2008 11:39 AM by Pete Muir

    Could not passivate SFSB with JPA session

    Gábor Farkas Newbie

      Hi all,


      We have an exception coming from time to time in our j2ee application using seam. The j2ee container tries to passivate a SFSB but failes, because it holds an active hibernate session, which cannot be serialized. Pointing out the important parts of the log:


      2008-07-11 16:23:13,590 FATAL [org.jboss.serial.persister.RegularObjectPersister] error
      Caused by: java.lang.IllegalStateException: Cannot serialize a session while connected
           at org.hibernate.impl.SessionImpl.writeObject(SessionImpl.java:1928)
      2008-07-11 16:23:13,590 ERROR [STDERR]      at org.jboss.ejb3.cache.simple.StatefulSessionFilePersistenceManager.passivateSession(StatefulSessionFilePersistenceManager.java:390)
      2008-07-11 16:23:13,590 ERROR [STDERR]      at org.jboss.ejb3.cache.simple.SimpleStatefulCache.passivate(SimpleStatefulCache.java:301)
      2008-07-11 16:23:13,590 ERROR [STDERR]      at org.jboss.ejb3.cache.simple.SimpleStatefulCache$SessionTimeoutTask.run(SimpleStatefulCache.java:209)
      



      The exception comes when using a function from the web interface of the system. The browser gets no response, we see this exception in the log, and then nothing more happens to the session, we get no exception in our application.


      The stack trace contains no JSF or SEAM code, neither lines from our application code. The JBoss j2ee container should have mentioned which SFSB it is trying to passivate, at least ...


      There are some similar forum entries. http://lists.jboss.org/pipermail/jboss-user/2006-November/021678.html has a similar problem, but we have no stateful session bean in our application code. http://seamframework.org/Community/JavaxejbEJBExceptionCouldNotPassivateFailedToSaveState is also similar, but there is no faces code in our exception stack trace.


      I paste the full stack trace here:


      2008-07-11 16:23:13,590 FATAL [org.jboss.serial.persister.RegularObjectPersister] error
      java.lang.reflect.InvocationTargetException
           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:597)
           at org.jboss.serial.persister.RegularObjectPersister.writeSlotWithMethod(RegularObjectPersister.java:120)
           at org.jboss.serial.persister.RegularObjectPersister.defaultWrite(RegularObjectPersister.java:86)
           at org.jboss.serial.persister.RegularObjectPersister.writeData(RegularObjectPersister.java:62)
           at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:276)
           at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:206)
           at org.jboss.serial.persister.RegularObjectPersister.writeSlotWithFields(RegularObjectPersister.java:182)
           at org.jboss.serial.persister.RegularObjectPersister.defaultWrite(RegularObjectPersister.java:90)
           at org.jboss.serial.persister.RegularObjectPersister.writeData(RegularObjectPersister.java:62)
           at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:276)
           at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:206)
           at org.jboss.serial.persister.ObjectOutputStreamProxy.writeObjectOverride(ObjectOutputStreamProxy.java:60)
           at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322)
           at java.util.LinkedList.writeObject(LinkedList.java:943)
           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:597)
           at org.jboss.serial.persister.RegularObjectPersister.writeSlotWithMethod(RegularObjectPersister.java:120)
           at org.jboss.serial.persister.RegularObjectPersister.defaultWrite(RegularObjectPersister.java:86)
           at org.jboss.serial.persister.RegularObjectPersister.writeData(RegularObjectPersister.java:62)
           at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:276)
           at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:206)
           at org.jboss.serial.persister.RegularObjectPersister.writeSlotWithFields(RegularObjectPersister.java:182)
           at org.jboss.serial.persister.RegularObjectPersister.defaultWrite(RegularObjectPersister.java:90)
           at org.jboss.serial.persister.RegularObjectPersister.writeData(RegularObjectPersister.java:62)
           at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:276)
           at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:206)
           at org.jboss.serial.persister.ArrayPersister.saveObjectArray(ArrayPersister.java:110)
           at org.jboss.serial.persister.ArrayPersister.writeData(ArrayPersister.java:101)
           at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:276)
           at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:206)
           at org.jboss.serial.io.JBossObjectOutputStream.writeObjectOverride(JBossObjectOutputStream.java:181)
           at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322)
           at org.jboss.serial.io.MarshalledObject.<init>(MarshalledObject.java:51)
           at org.jboss.ejb3.stateful.StatefulBeanContext.writeExternal(StatefulBeanContext.java:857)
           at org.jboss.serial.persister.ExternalizePersister.writeData(ExternalizePersister.java:58)
           at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:276)
           at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:206)
           at org.jboss.serial.io.JBossObjectOutputStream.writeObjectOverride(JBossObjectOutputStream.java:181)
           at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322)
           at org.jboss.ejb3.cache.simple.StatefulSessionFilePersistenceManager.passivateSession(StatefulSessionFilePersistenceManager.java:390)
           at org.jboss.ejb3.cache.simple.SimpleStatefulCache.passivate(SimpleStatefulCache.java:301)
           at org.jboss.ejb3.cache.simple.SimpleStatefulCache$SessionTimeoutTask.run(SimpleStatefulCache.java:209)
      Caused by: java.io.IOException
           at org.jboss.serial.persister.RegularObjectPersister.writeSlotWithMethod(RegularObjectPersister.java:129)
           at org.jboss.serial.persister.RegularObjectPersister.defaultWrite(RegularObjectPersister.java:86)
           at org.jboss.serial.persister.RegularObjectPersister.writeData(RegularObjectPersister.java:62)
           at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:276)
           at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:206)
           at org.jboss.serial.persister.RegularObjectPersister.writeSlotWithFields(RegularObjectPersister.java:182)
           at org.jboss.serial.persister.RegularObjectPersister.defaultWrite(RegularObjectPersister.java:90)
           at org.jboss.serial.persister.RegularObjectPersister.writeData(RegularObjectPersister.java:62)
           at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:276)
           at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:206)
           at org.jboss.serial.persister.RegularObjectPersister.writeSlotWithFields(RegularObjectPersister.java:182)
           at org.jboss.serial.persister.RegularObjectPersister.defaultWrite(RegularObjectPersister.java:90)
           at org.jboss.serial.persister.RegularObjectPersister.writeData(RegularObjectPersister.java:62)
           at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:276)
           at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:206)
           at org.jboss.serial.persister.RegularObjectPersister.writeSlotWithFields(RegularObjectPersister.java:182)
           at org.jboss.serial.persister.RegularObjectPersister.defaultWrite(RegularObjectPersister.java:90)
           at org.jboss.serial.persister.RegularObjectPersister.writeData(RegularObjectPersister.java:62)
           at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:276)
           at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectOutput.writeObject(DataContainer.java:206)
           at org.jboss.serial.persister.ObjectOutputStreamProxy.writeObjectOverride(ObjectOutputStreamProxy.java:60)
           at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:322)
           at java.util.ArrayList.writeObject(ArrayList.java:570)
           ... 47 more
      Caused by: java.lang.reflect.InvocationTargetException
           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:597)
           at org.jboss.serial.persister.RegularObjectPersister.writeSlotWithMethod(RegularObjectPersister.java:120)
           ... 69 more
      Caused by: java.lang.IllegalStateException: Cannot serialize a session while connected
           at org.hibernate.impl.SessionImpl.writeObject(SessionImpl.java:1928)
           ... 74 more
      



      We can investigate the problem further maybe on monday.
      Thank you for any help.