0 Replies Latest reply on Jun 23, 2011 5:41 AM by Amar Gehani

    Could not passivate; failed to save state in JBoss EAP

    Amar Gehani Newbie

      We are migrating our application from Websphere 6.1 to JBoss EAP 5.0.

      When the ejbPassivate() method is called during the life cycle of the statefull session bean, we are getting the following error :

       

       

      WARN  [org.jboss.ejb.plugins.AbstractInstanceCache] (Timer-2) failed to passivate, id=gp1mql4e-bcq
      javax.ejb.EJBException: Could not passivate; failed to save state
             at org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager.passivateSession(StatefulSessionFilePersistenceManager.java:423)
             at org.jboss.ejb.plugins.StatefulSessionInstanceCache.passivate(StatefulSessionInstanceCache.java:107)
             at org.jboss.ejb.plugins.AbstractInstanceCache.tryToPassivate(AbstractInstanceCache.java:209)
             at org.jboss.ejb.plugins.AbstractInstanceCache.tryToPassivate(AbstractInstanceCache.java:162)
             at org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy$OveragerTask.run(LRUEnterpriseContextCachePolicy.java:467)
             at java.util.TimerThread.mainLoop(Timer.java:512)
             at java.util.TimerThread.run(Timer.java:462)
      Caused by: java.io.NotSerializableException: com.xxx.core.data.terms.DateTerm
             at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
             at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
             at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
             at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
             at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
             at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
             at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
             at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
             at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
             at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
             at java.util.HashMap.writeObject(HashMap.java:1001)
             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 java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
             at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1461)
             at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
             at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
             at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
             at java.util.HashMap.writeObject(HashMap.java:1001)
             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 java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
             at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1461)
             at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
             at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
             at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
             at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
             at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
             at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
             at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
             at org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager.passivateSession(StatefulSessionFilePersistenceManager.java:414)
             ... 6 more
      
      

          

       

       

      But when we run the same code on Websphere 6.1 we are not getting the above mentioned error.

       

      We have checked 

       

      com.xxx.core.data.terms.DateTerm
      

       

      is not implementing Serializable interface and according to the J2EE EJB specification non static fields of the stateful session bean should implement Serializable interface.

       

      We are just wondering how it works with websphere 6.1.

      Is it a bug in websphere or are we missing something here?

      Any help would be appreciated.