2 Replies Latest reply on Mar 28, 2006 6:58 AM by Gregor Grambow

    Passivation of context

    Gregor Grambow Newbie

      hello everyone!

      now i'm back with maybe another silly question:
      it's a serialisation/passivation problem. when running my application after a while i get an exception in the time thread that wants to passivate my beans. i've made them all implement serializable. the problem remains for the for the faces context. the exception looks as follows:

      09:36:08,046 INFO [STDOUT] Exception in thread "Timer-5"
      09:36:08,046 INFO [STDOUT] javax.ejb.EJBException: Could not passivate; failed to save state; CausedByException is:
       org.apache.myfaces.context.servlet.ServletFacesContextImpl
      09:36:08,046 INFO [STDOUT] at org.jboss.ejb3.cache.simple.StatefulSessionFilePersistenceManager.passivateSession(StatefulSessionFilePersistenceManager.java:333)
      09:36:08,046 INFO [STDOUT] at org.jboss.ejb3.cache.simple.SimpleStatefulCache.passivate(SimpleStatefulCache.java:143)
      09:36:08,046 INFO [STDOUT] at org.jboss.ejb3.cache.simple.SimpleStatefulCache$SessionTimeoutTask.run(SimpleStatefulCache.java:92)
      09:36:08,046 INFO [STDOUT] at java.util.TimerThread.mainLoop(Timer.java:512)
      09:36:08,046 INFO [STDOUT] at java.util.TimerThread.run(Timer.java:462)
      09:36:08,046 INFO [STDOUT] java.io.NotSerializableException: org.apache.myfaces.context.servlet.ServletFacesContextImpl
      09:36:08,046 INFO [STDOUT] at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1075)
      09:36:08,046 INFO [STDOUT] at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1369)
      09:36:08,046 INFO [STDOUT] at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1341)
      09:36:08,062 INFO [STDOUT] at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)
      09:36:08,062 INFO [STDOUT] at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
      09:36:08,062 INFO [STDOUT] at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)
      09:36:08,062 INFO [STDOUT] at org.jboss.aop.metadata.SimpleMetaData.writeExternal(SimpleMetaData.java:211)
      09:36:08,062 INFO [STDOUT] at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1304)
      09:36:08,062 INFO [STDOUT] at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1282)
      09:36:08,078 INFO [STDOUT] at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
      09:36:08,078 INFO [STDOUT] at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)
      09:36:08,078 INFO [STDOUT] at java.rmi.MarshalledObject.<init>(MarshalledObject.java:92)
      09:36:08,078 INFO [STDOUT] at org.jboss.ejb3.stateful.StatefulBeanContext.writeExternal(StatefulBeanContext.java:153)
      09:36:08,078 INFO [STDOUT] at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1304)
      09:36:08,078 INFO [STDOUT] at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1282)
      09:36:08,078 INFO [STDOUT] at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
      09:36:08,078 INFO [STDOUT] at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)
      09:36:08,078 INFO [STDOUT] at org.jboss.ejb3.cache.simple.StatefulSessionFilePersistenceManager.passivateSession(StatefulSessionFilePersistenceManager.java:324)
      09:36:08,078 INFO [STDOUT] at org.jboss.ejb3.cache.simple.SimpleStatefulCache.passivate(SimpleStatefulCache.java:143)
      09:36:08,078 INFO [STDOUT] at org.jboss.ejb3.cache.simple.SimpleStatefulCache$SessionTimeoutTask.run(SimpleStatefulCache.java:92)
      09:36:08,078 INFO [STDOUT] at java.util.TimerThread.mainLoop(Timer.java:512)
      09:36:08,078 INFO [STDOUT] at java.util.TimerThread.run(Timer.java:462)
      


      could you tell me what i've forgotten?

        • 1. Re: Passivation of context
          Gavin King Master

          Did you inject the FacesContext into your SFSB and not mark the field transient?

          (Easy to do, I do it all the friggin time...)

          • 2. Re: Passivation of context
            Gregor Grambow Newbie

            Again thanks for the quick answer gavin!

            yes i injected it and didnt mark it transient.
            now i tried it but it didnt work.
            and i've seen that in the seam beta 1 booking example it isnt marked transient but it does work. is there maybe something configured in a special way? or could i have forgotten something else important?
            (i forget things far too often, had also some beans that still didnt implement serializable too, that's fixed now...)