[EJB/JBoss] - Could not passivate; failed to save state
by ricardomarques
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):
| protected transient Log log;
| private transient IdentitySession identitySession;
|
| public void 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?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4056598#4056598
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4056598
18Â years, 10Â months
[JBoss Seam] - Seam Eclipse project structure (newbie question)
by tptackab
I'm still rather new at Seam (and web development) and I'm finding it difficult to setup a Seam POJO project using a standard WTP JSF 1.2 (dynamic web) project. I understand the packaging structure defined in the Seam reference doc; however, I'm unsure as to how that would translate into my development project structure.
I'm using Eclipse 3.3 + WTP JSF 1.2. When I create a new project, Eclipse creates (and expects) a structure like this:
my-application/
| src/
| com.myapp.foo.java
| com.myapp.bar.java
| ...
| WebContent/
| index.html
| index.xhtml
| foopage.xhtml
| barpage.xhtml
| META-INF/
| MANIFEST.MF
| WEB-INF/
| faces-config.xml
| web.xml
| LIB/
| el-api.jar
| el-ri.jar
| jsf-facelets.jar
| ...
The Seam reference document (J2EE/pojo) example shows the following packaging:
my-application.war/
| META-INF/
| MANIFEST.MF
| WEB-INF/
| web.xml
| components.xml
| faces-config.xml
| lib/
| jboss-seam.jar
| jboss-seam-ui.jar
| el-api.jar
| el-ri.jar
| jsf-facelets.jar
| hibernate3.jar
| hibernate-annotations.jar
| ...
| my-application.jar/
| META-INF/
| MANIFEST.MF
| seam.properties
| hibernate.cfg.xml
| org/
| jboss/
| myapplication/
| User.class
| Login.class
| Register.class
| ...
| login.jsp
| register.jsp
| ...
The example above shows the project source JARd up with seam.properties and the hibernate config files. Is it necessary to create this JAR, i.e can those files "live" in src/, the web root, or WEB-INF during development? Can I deploy those files exploded somewhere else in the standard Eclipse-built war structure during development?
My best guess would be as follows:
my-application/
| src/
| com.myapp.foo.java
| com.myapp.bar.java
| ...
| WebContent/
| index.html
| index.xhtml
| foopage.xhtml
| barpage.xhtml
| META-INF/
| MANIFEST.MF
| WEB-INF/
| faces-config.xml
| web.xml
| components.xml
| seam.properties
| LIB/
| jboss-seam.jar
| jboss-seam-ui.jar
| el-api.jar
| el-ri.jar
| jsf-facelets.jar
| hibernate3.jar
| hibernate-annotations.jar
| ...
I've not had any luck with the above structure so far, but that might be becuase of other configuration issues, missing libs, ingnorant newbie, etc. :-)
Am I on the right track?
If you've accomplished this in Eclipse, I would very much appreciate an example.
Thanks!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4056597#4056597
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4056597
18Â years, 10Â months