Could not passivate; failed to save state

Hi guys

I'm using ejb with a web application on jboss 4.0.5 with jdk 1.5 and i'm getting this exception:

11:53:50,390 WARN [AbstractInstanceCache] failed to passivate, id=f373o8gy-s

javax.ejb.EJBException: Could not passivate; failed to save state

at org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager.passivateSession(StatefulSessionFilePersistenceManager.java:423)

at org.jboss.ejb.plugins.StatefulSessionInstanceCache.passivate(StatefulSessionInstanceCache.java:107)

at org.jboss.ejb.plugins.AbstractInstanceCache.tryToPassivate(AbstractInstanceCache.java:209)

at org.jboss.ejb.plugins.AbstractInstanceCache.tryToPassivate(AbstractInstanceCache.java:162)

at org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy$OveragerTask.run(LRUEnterpriseContextCachePolicy.java:450)

at java.util.TimerThread.mainLoop(Timer.java:512)

at java.util.TimerThread.run(Timer.java:462)

Caused by: java.io.NotSerializableException: java.lang.ThreadLocal

at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081)

at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)

at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)

at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)

at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)

at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)

at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)

at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)

at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)

at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)

at org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager.passivateSession(StatefulSessionFilePersistenceManager.java:414)

... 6 more

My code (Session bean statefull):

protectedtransient Log log;

privatetransient IdentitySession identitySession;

publicvoid ejbPassivate()throws EJBException, RemoteException{

log.debug("bean passivating... ");

log =null;

identitySession.close();

identitySession =null;

}

the attributes are transient because i had read somewhere that like that i could avoid serialization problems. but they remain, i've tried with and without them and the output is the same.

IdentitySession is a non-serializable object and Log is a interface from commons logging also non-serializable.

can anyone help?

Message was edited by:

RicardoM

[3078 byte] By [RicardoMa] at [2007-11-27 8:24:55]
# 1
So those are the ONLY fields in your bean? Does the class declare a ThreadLocal field or is asuper-class that declares a ThreadLocal field?If not, it could be a JBoss bug. I'd recommendposting on the JBoss forum.
ksaksa at 2007-7-12 20:14:08 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
No, I have 2 more, but those implement Serializable for sure. java.lang.ThreadLocal never seen that, must be something from JBoss implementation.
RicardoMa at 2007-7-12 20:14:08 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...