1 Reply Latest reply on Feb 5, 2002 1:51 PM by Armin

    Stateful passivation problem (serialization)

    Egan Allen Newbie

      I have an instance variable jndiContext of type Context that is assigned new InitialContext() in the setSessionContext() method in my stateful session EJBs. I realize that javax.naming.Context is not serializable but I understood that the container (as per the EJB1.1/2.0 spec) should still be able to deal with this instance variable given it is of javax.naming.Conext (and thus, javax.naming.InitialContext) and NOT hinder passivation.

      Here is server.log info:

      [Bean Cache] Scheduling for passivation overaged bean LineageManagerEJB with id = 1012776007792 - Cache size = 1
      [Bean Cache] Aging out from cache bean LineageManagerEJBwith id = 1012776007792; cache size = 1
      [Container factory] Scheduled passivation of bean LineageManagerEJB with id = 1012776007792
      [Container factory] java.rmi.ServerException: Could not passivate; nested exception is:
      [Container factory] java.io.NotSerializableException: javax.naming.InitialContext
      [Container factory] java.io.NotSerializableException: javax.naming.InitialContext
      [Container factory] at java.io.ObjectOutputStream.outputObject(Unknown Source)
      [Container factory] at java.io.ObjectOutputStream.writeObject(Unknown Source)
      [Container factory] at java.io.ObjectOutputStream.outputClassFields(Unknown Source)
      [Container factory] at java.io.ObjectOutputStream.defaultWriteObject(Unknown Source)
      [Container factory] at java.io.ObjectOutputStream.outputObject(Unknown Source)
      [Container factory] at java.io.ObjectOutputStream.writeObject(Unknown Source)
      [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(Unknown Source)

      Help!!
      thanks,
      Egan Allen