3 Replies Latest reply on Feb 13, 2002 9:53 PM by Hannu

    Not Serializable

    Gordon Luk Newbie

      Hi all,

      i got a problem, that is jboss say that my ejb is not serializable, but i am not sure which/where one of ejb objects got problem, here is jboss return...

      --- >%----
      [Container factory] java.rmi.ServerException: Could not passivate; nested exception is:
      [Container factory] java.io.NotSerializableException: org.jboss.pool.jdbc.xa.XAPoolDataSource
      [Container factory] java.io.NotSerializableException: org.jboss.pool.jdbc.xa.XAPoolDataSource
      [Container factory] at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1148)
      [Container factory] at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366)
      [Container factory] at java.io.ObjectOutputStream.outputClassFields(ObjectOutputStream.java:1827)
      [Container factory] at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:480)
      [Container factory] at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1214)
      [Container factory] at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366)
      [Container factory] at org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager.passivateSession(StatefulSessionFilePersistenceManager.java:285)
      [Container factory] at org.jboss.ejb.plugins.StatefulSessionInstanceCache.passivate(StatefulSessionInstanceCache.java:67)
      [Container factory] at org.jboss.ejb.plugins.AbstractInstanceCache$1.execute(AbstractInstanceCache.java:709) [Container factory] at org.jboss.util.WorkerQueue$QueueLoop.run(WorkerQueue.java:199)
      [Container factory] at java.lang.Thread.run(Thread.java:484)
      [Container factory] java.rmi.ServerException: Could not passivate; nested exception is:
      [Container factory] java.io.NotSerializableException: org.jboss.pool.jdbc.xa.XAPoolDataSource
      [Container factory] java.io.NotSerializableException: org.jboss.pool.jdbc.xa.XAPoolDataSource
      [Container factory] at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1148)
      [Container factory] at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366)
      [Container factory] at java.io.ObjectOutputStream.outputClassFields(ObjectOutputStream.java:1827)
      [Container factory] at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:480)
      [Container factory] at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1214)
      [Container factory] at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366)
      [Container factory] at org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager.passivateSession(StatefulSessionFilePersistenceManager.java:285)
      ------>8--------

      can i set the log4j provide more details ? and how?

      Gordon

        • 1. Re: Not Serializable
          Lennart Petersson Novice

          Please have a lock on all your attributes of the stateful session bean (well all non-transient attributes). Probably at least one of them is not serializable, directly or indirectly.

          /Lennart

          • 2. Re: Not Serializable
            Horia Muntean Newbie

            Probabily right. Probabily u have a datasource declared in your SFSB(statefull session bean) witch is not serializable. U souldn't do this. try to get the DS from the environment everytime you use it or declare it null before the bean gets passivated(and in this latter case be sure to load it again at bean activation time).See the SFSB life cycle to learn when the container passivates or activates the bean.

            • 3. Re: Not Serializable
              Hannu Newbie

              Yes, you were right, I had the datasource as non-transient, and not set to null on ejbPassivate.

              Do I need to set the datasource to transient, and null it also on stateless beans.

              Thank you.