5 Replies Latest reply on Mar 30, 2005 10:52 AM by bill.burke

    Cannot Passivate Stateful Session Bean

    guurk

      I'm getting this EJBException:

      Exception in thread "Timer-7"
      javax.ejb.EJBException: Could not passivate; failed to save state; CausedByException is:

      org.gmud.server.ejb.session.GMudSession
      at org.jboss.ejb3.cache.simple.StatefulSessionFilePersistenceManager.passivateSession(StatefulSessionFilePersistenceManager.java:335)
      at org.jboss.ejb3.cache.simpleSimpleStatefulCache.passivate(SimpleStatefulCache.java:143)

      Just figured that someone would want to know. I have to bring down the server and bring back up again before this one fixes...

        • 1. Re: Cannot Passivate Stateful Session Bean
          bill.burke

          Are you sure this is not a bug in your Stateful bean class?

          * Is it Serializable?
          * Do you have a non-transient field that is non-serializable?

          I ask this because we do actually test this stuff...

          • 2. Re: Cannot Passivate Stateful Session Bean
            guurk

            Oh, I'm sure I screwed up somewhere... never worry :P.

            The question is more what I screwed up...

            The only member variable is one for a reference to a single entity. And yes, that is serializable.

            However, oddly that particular variable is still null when trying to passivate. So it shouldn't effect anything.

            I've even put in @PrePassivate and @PostActivate to double check things... to no avail.

            (A full code post is difficult since the code is on a non-internet connected network).

            • 3. Re: Cannot Passivate Stateful Session Bean
              guurk

              Doh... my bad... just like I said.

              I guess I should actually read your post ;).

              My stateful is now serializable and works just fine...

              It might however be a good idea to include that in the Stateful tutorial... just a thought.

              Thanks.

              • 4. Re: Cannot Passivate Stateful Session Bean
                bill.burke

                A good test is to add a method to your SFSB:

                Particularly:

                public void serializeMe() {
                java.rmi.MarshalledObject mo = new MarshalledObject(this);
                mo.get();
                }

                There could be a bug in our code...Do you ahve any services like UserTrasnaction, EntityManager, etc... as members of the SFSB class?

                • 5. Re: Cannot Passivate Stateful Session Bean
                  bill.burke

                   

                  "guurk" wrote:
                  It might however be a good idea to include that in the Stateful tutorial... just a thought.


                  Doh! I'm a *bleepin* idiot...Tutorial fixed...Apologies.