4 Replies Latest reply on Nov 22, 2002 12:09 AM by muradhak

    Attempting to passivate : ERROR

    muradhak

      Hi,
      I am having the following Error in my application. I am not having any visible error from my application, but just curious to know what is causing this error.

      Previously My application was having its own log4j. To solve this error I thought of having only JBoss-log4j.

      But no use, the error is still there.

      ========================================================
      DEBUG 20/Nov/2002 18:03:19 [EJB Passivator Thread] (Logger.java:117): plugins.StatefulSessionFilePersistenceManager - Attempting to passivate; ctx=org.jboss.ejb.StatefulSessionEnterpriseContext@482208

      ERROR 20/Nov/2002 18:03:19 [EJB Passivator Thread] (Logger.java:194): logging.Log4jService$ThrowableListenerLoggingAdapter - unhandled throwable

      java.rmi.ServerException: Could not passivate; nested exception is:
      java.io.NotSerializableException: org.apache.log4j.Logger
      java.io.NotSerializableException: org.apache.log4j.Logger
      at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1143)
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:361)
      at java.io.ObjectOutputStream.outputClassFields(ObjectOutputStream.java:1822)
      at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:475)
      at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1209)
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:361)
      at org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager.passivateSession(StatefulSessionFilePersistenceManager.java:288)
      at org.jboss.ejb.plugins.StatefulSessionInstanceCache.passivate(StatefulSessionInstanceCache.java:78)
      at org.jboss.ejb.plugins.AbstractInstanceCache$1.execute(AbstractInstanceCache.java:615)
      at org.jboss.util.WorkerQueue$QueueLoop.run(WorkerQueue.java:206)
      at java.lang.Thread.run(Thread.java:479)
      =========================================================

      Cheers
      Muraly

        • 1. Re: Attempting to passivate : ERROR

          Declare your logger "final static"

          Regards,
          Adrian

          • 2. Re: Attempting to passivate : ERROR
            muradhak

            Hi Adrian,
            First, thanks for the support during java.lang.OutOfMemory error. I did reduce the chache size as well as addec the java option -Xmx256m. This was option also with JOnAs. So that issue got resolved.

            Now the next issue is with the Logger. Our application is having a Logger calss, which uses Category of org.apache.log4j. We were using an old version of log4j. So changed some code in our Logger to suit Jboos log4j. As I said earlier, the erro persist.

            To make myself clear of your suggestion, declare the Logger class itself final or did you mean whereever Logger is used declare is as final and static. I think the latter scenario is already followed.

            Cheers
            Muarly

            • 3. Re: Attempting to passivate : ERROR

              If you declare an object static, it is at class level
              and won't be serialized during passivation.
              final is for spec compliance.

              Regards,
              Adrian

              • 4. Re: Attempting to passivate : ERROR
                muradhak

                Hi Adrian,
                I got around the problem in a round abt way!.
                The Beans that were throwing this error were stateful beans. Since the Category(log4j) class is not serializable, during passiavtion it throws the error. Am I right?
                I changed all these beans into Stateless beans, the problem got resolved.
                The reason being in our app it these beans doesnt use any state to be stored.

                Thanks
                Muraly