Discussions

EJB programming & troubleshooting: problem with stateful session bean

  1. problem with stateful session bean (2 messages)

    hi guys

    i have a problem when maintaining a collection of local entity component interfaces as the state of a stateful session bean.

    i get the following error on jboss , could anyone tell me the reason for this . because from what i understand the aforementioned collection is serializable.

    any help on this will be greatly appreciated.

    javax.ejb.EJBException: Could not passivate; failed to save state; CausedByException is:
            java.util.logging.LogManager
            at org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager.passivateSession(State
            at org.jboss.ejb.plugins.StatefulSessionInstanceCache.passivate(StatefulSessionInstan
            at org.jboss.ejb.plugins.AbstractInstanceCache.tryToPassivate(AbstractInstanceCache.j
            at org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy$OveragerTask.run(LRUEnterpri
            at java.util.TimerThread.mainLoop(Timer.java:432)
            at java.util.TimerThread.run(Timer.java:382)
    java.io.NotSerializableException: java.util.logging.LogManager
            at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054)
            at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
            at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304)
            at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
  2. From what I can tell from the stack trace, you seem to have a reference to the java.util.logging.LogManager in your class. The LogManager does not implement Serializable and therefore JBoss cannot passivate your session bean (since some references in the session bean cannot be serialized).
  3. problem with stateful session bean[ Go to top ]

    Is it possible for you to subclass from the Log Manager but implement the java.io.Serializable interface so that you can have your log object and be serializable.

    That would solve your problem but it seems funny that you want to persist the log manager when it would be better that you obtain the Logger object from the LogManager and use it as a local object?