7 Replies Latest reply on Apr 22, 2002 3:09 AM by taiwubrian

    Could not passivate????

    ljubisak

      I have used Sun's PetStore Demo approach to build my latest App EJB component, but I'm getting "Could not passivate" exception with JBoss 3.0 alpha. I have already downloaded JBossCMP-Docs for JBoss with example and realize that all EJBs using:

      transient private EntityContext ctx;

      Is this the problem, the way how EntityContext has been implemented in JBoss, or the reason could be something else.



      ---------------------------
      [10:55:50,261,PassivatorQueue] EXCEPTION
      java.rmi.ServerException: Could not passivate; nested exception is:
      java.io.NotSerializableException: org.jboss.ejb.plugins.local.BaseLocalC
      ontainerInvoker$StatefulSessionProxy
      java.io.NotSerializableException: org.jboss.ejb.plugins.local.BaseLocalContainer
      Invoker$StatefulSessionProxy
      ------------------------

      I found same problem was posted earlier without reply, nobody gets the answer??????????

      ---------------------------------
      http://main.jboss.org/thread.jsp?forum=46&thread=10963&message=1350274&q=Could+not+passivate#1350274
      -----------------------------------

        • 1. Re: Could not passivate????
          stitzl

          In my API documentation it says, regarding java.io.NotSerializableException:

          "Thrown when an instance is required to have a Serializable interface. The serialization runtime or the class of the instance can throw this exception. The argument should be the name of the class. "

          And, lo and behold, the class org.jboss.ejb.plugins.local.BaseLocalContainerInvoker$StatefulSessionProxy does not seem to implement the Serializable interface.

          Might this solve the problem?

          • 2. Re: Could not passivate????
            scoy

            I believe that this is a bug in JBoss, and actually created a bug report (#541855) for it a couple of weeks ago.

            Basically, the passivation of stateful session beans is not EJB2.0 compliant yet.

            • 3. Re: Could not passivate????
              ljubisak

              Thank you for your reply,

              I'm very familiar with serialization and what cause this exception in general terms, but I don't have the clear picture about JBoss Pasivation mechanizm since it's obvoiusly slightly "differant" then one inside Sun's J2EE server (J2EE SDK 1.3.1, EJB 2.0).
              I also made a small error when posting, the exception posted is related to the SessionContext and I was mentioning EntityContext, in fact in both cases the problem is same.

              And if the problem is solved by taking care that all objects referenced inside EJBs are serializable or otherwise declared transient, it's fine.

              Just I hoped to get straight forward answer how to avoid this Pasivation problem from someone familiar with JBoss implementation of EJB2.0.

              And if Contexts are not serialized during pasivation does it affect anything else?

              • 4. Re: Could not passivate????
                taiwubrian

                I have been having this problem since the first release of 3.0.0alpha. Unfortunately, no one ever provide a solution. I thought that was a problem of my system. Apparently it didn't.

                This problem doesn't block any accesses to db. However, sometimes when doing hot deployment of my jar file, jboss will endlessly report the error message and the log file keeps growing until I shut jboss down. I get along with this problem but ignoring it.

                Please someone help.

                Brian

                • 5. Re: Could not passivate????
                  ljubisak

                  thanks Brian,

                  It's same thing with me.

                  I thought I would get rid of those problems if I provide only serializable attributes inside my EJBs, and it didn't help, so it's comming from some JBoss classes.

                  I was hoping that someone familiar with JBoss implementation of EJB 2.0 would have the answer how to get rid of this kind of the problem.
                  (I got straight answer that solved my EJBs 2.0 problems a few months ago from Dain)

                  Or at least the answer what's class trying to serialize those:
                  "org.jboss.ejb.plugins.local.BaseLocalC
                  ontainerInvoker$StatefulSessionProxy" and Entity one.
                  if there are not serializable and why (is it's my error or problem with JBoss)


                  • 6. Re: Could not passivate????
                    yasirsk

                    I encountered the same problem with a session bean that acceced the database in 2.4.4. this was solved by making the SQL connection and all other non-serializeable fields as transient. furthermore, in ejbPassivate all connections and nonserializeable fields were set to null. what this has done is rather queer. when the EJB passivates, *sometimes* one instance of the EJB does not passivate and throws an error, for example i might have 5 beans in the pool, 4 will passivate and one will throw an exception.

                    haven't tried in 3.0. you can try the above sol.

                    • 7. Re: Could not passivate????
                      taiwubrian

                      Hi,

                      Good news!. The passavation problem is said to be solved in 3.0, 3.1 CVS and posssibly RC2.