5 Replies Latest reply on May 20, 2003 7:50 AM by Sven Do

    Could not passivate

    garyg Novice

      I'm getting the error below on my JB 3.0.6 server output. My application seems to run fine even with these excepitons, but it's messy looking. Of course I don't rely on the container to activate or passivate since I don't believe it has to and that can cause *connection leaks*.

      Any ideas much appreciated.

      23:53:05,787 ERROR [Log4jService$ThrowableListenerLoggingAdapter] unhandled throwable
      javax.ejb.EJBException: Could not passivate; CausedByException is:
      org.jboss.resource.adapter.jdbc.local.LocalConnection
      at

      org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager.passivateSession(StatefulSessionFilePersistenceManager.java:294

      )
      at org.jboss.ejb.plugins.StatefulSessionInstanceCache.passivate(StatefulSessionInstanceCache.java:78)
      at org.jboss.ejb.plugins.AbstractInstanceCache$1.execute(AbstractInstanceCache.java:616)
      at org.jboss.util.WorkerQueue$QueueLoop.run(WorkerQueue.java:206)
      at java.lang.Thread.run(Thread.java:479)
      java.io.NotSerializableException: org.jboss.resource.adapter.jdbc.local.LocalConnection
      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:616)
      at org.jboss.util.WorkerQueue$QueueLoop.run(WorkerQueue.java:206)
      at java.lang.Thread.run(Thread.java:479)
      23:54:56,639 ERROR [Log4jService$ThrowableListenerLoggingAdapter] unhandled throwable
      javax.ejb.EJBException: Could not passivate; CausedByException is:
      org.jboss.mq.il.oil.OILClientILService
      at

      org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager.passivateSession(StatefulSessionFilePersistenceManager.java:294

      )
      at org.jboss.ejb.plugins.StatefulSessionInstanceCache.passivate(StatefulSessionInstanceCache.java:78)
      at org.jboss.ejb.plugins.AbstractInstanceCache$1.execute(AbstractInstanceCache.java:616)
      at org.jboss.util.WorkerQueue$QueueLoop.run(WorkerQueue.java:206)
      at java.lang.Thread.run(Thread.java:479)
      java.io.NotSerializableException: org.jboss.mq.il.oil.OILClientILService
      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 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:616)
      at org.jboss.util.WorkerQueue$QueueLoop.run(WorkerQueue.java:206)
      at java.lang.Thread.run(Thread.java:479)
      23:54:56,661 ERROR [Log4jService$ThrowableListenerLoggingAdapter] unhandled throwable
      javax.ejb.EJBException: Could not passivate; CausedByException is:
      org.jboss.mq.il.oil.OILClientILService
      at

      org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager.passivateSession(StatefulSessionFilePersistenceManager.java:294

      )
      at org.jboss.ejb.plugins.StatefulSessionInstanceCache.passivate(StatefulSessionInstanceCache.java:78)
      at org.jboss.ejb.plugins.AbstractInstanceCache$1.execute(AbstractInstanceCache.java:616)
      at org.jboss.util.WorkerQueue$QueueLoop.run(WorkerQueue.java:206)
      at java.lang.Thread.run(Thread.java:479)
      java.io.NotSerializableException: org.jboss.mq.il.oil.OILClientILService
      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 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:616)
      at org.jboss.util.WorkerQueue$QueueLoop.run(WorkerQueue.java:206)
      at java.lang.Thread.run(Thread.java:479)


        • 1. Re: Could not passivate
          Bernd Zeitler Expert

          Hi,

          > Of course I
          > don't rely on the container to activate or passivate
          > since I don't believe it has to and that can cause
          > *connection leaks*.
          How are you going to anticipate passivation? I seems, that the container is of another opinion and tries to passivate your SFSB.
          IMO, the bean is not properly serializable, that's why the exception is thrown (probably you are holding something like a connection, to avoid your *connection leaks*).
          Your application won't run fine, because the acivation of the session should fail (well, it couldn't be passivated at all).

          Greetings,
          Frito

          • 2. Re: Could not passivate
            garyg Novice

            Not sure I understand ... In every method in my EJB (entity) that makes a connection, I do a 'finally {...}' that test to see if my EJB is still holding a connection, and close() if it is. So I open it and close it in each method and don't rely on the container to open and close them during ejbActivate() and ejbPassivate(). So this shouldn't be causing it.

            Any other ideas?

            • 3. Re: Could not passivate
              Sven Do Newbie

              I have the same "could not passivate" problem. I'm using JB 3.0.6 and hsqldb 1.7.1. In ejbPassivate() I close the connection. Does "CausedByException is: org.jboss.resource.adapter.jdbc.local.LocalConnection" refer to the datasource/database? Could the problem be caused by a property in the corresponding hsqldb-service.xml?

              • 4. Re: Could not passivate
                Bernd Zeitler Expert

                Even if you are closing the connection, you are still holding a reference to it.
                If you don't need it any more, assign null to the attribute, at least when ejbPassivate() is called!

                Greetings,
                Frito

                • 5. Re: Could not passivate
                  Sven Do Newbie

                  Thanks a lot!
                  Clearly, closing the connection doesn't mean there is no reference left ;-)