aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Stateful session bean can not be activate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Stateful session bean can not be activate" Watch "Stateful session bean can not be activate" New topic
Author

Stateful session bean can not be activate

somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
I'm got this error

2547-04-22 22:28:00,728 DEBUG [org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager] Attempting to activate; ctx=org.jboss.ejb.StatefulSessionEnterpriseContext@140a531
2547-04-22 22:28:00,728 DEBUG [org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager] Reading session state from: D:\jboss-3.2.1_tomcat-4.1.24\server\default\tmp\sessions\SearchPatientManage-dtcpwdvw-r\dtcy9x08-2j.ser
2547-04-22 22:28:00,728 DEBUG [org.jboss.ejb.plugins.AbstractInstanceCache] Activation failure
javax.ejb.EJBException: Could not activate; failed to restore state; CausedByException is:
D:\jboss-3.2.1_tomcat-4.1.24\server\default\tmp\sessions\SearchPatientManage-dtcpwdvw-r\dtcy9x08-2j.ser (The system cannot find the file specified)
at org.jboss.ejb.plugins.StatefulSessionFilePersistenceManager.activateSession(StatefulSessionFilePersistenceManager.java:324)
at org.jboss.ejb.plugins.StatefulSessionInstanceCache.activate(StatefulSessionInstanceCache.java:90)
at org.jboss.ejb.plugins.AbstractInstanceCache.get(AbstractInstanceCache.java:113)
at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invoke(StatefulSessionInstanceInterceptor.java:212)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:243)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:104)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
at org.jboss.ejb.StatefulSessionContainer.internalInvoke(StatefulSessionContainer.java:410)
at org.jboss.ejb.Container.invoke(Container.java:674)
at sun.reflect.GeneratedMethodAccessor78.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:101)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:83)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:45)
at org.jboss.proxy.ejb.StatefulSessionInterceptor.invoke(StatefulSessionInterceptor.java:104)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:85)

Please help me on this problem ...


SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
Alex Sharkoff
Ranch Hand

Joined: Apr 11, 2004
Posts: 209
Somkiat,
That is what happened. Your stateful sb got passivated after it has been inactive for some time. Your app server (i.e. jboss) serialised the bean and saved it "D:\jboss-3.2.1_tomcat-4.1.24\server\default\tmp\sessions\SearchPatientManage-dtcpwdvw-r\dtcy9x08-2j.ser" file.
After the bean got timed out in the passivated (i.e. serialised) state the app server removed it - the file the bean got serialised to was deleted.
After all of the above happened your client that still had a reference to the bean's component interface tried to call a biz method on it. The first thing the app server did was to try to activate the bean (i.e. deserialise it). But the file (i.e. a file the bean has been serialised to) has been deleted and therefore the container cannot find it. That's why the app server throws "javax.ejb.EJBException: Could not activate; failed to restore state; CausedByException is: D:\jboss-3.2.1_tomcat-4.1.24\server\default\tmp\sessions\SearchPatientManage-dtcpwdvw-r\dtcy9x08-2j.ser (The system cannot find the file specified) "
In JBoss you can specify "maximum time in seconds a passivated bean can stay inactive before it has been removed". This is set in standardjboss.xml (container wide configuration, "cache configuration can be overridden for individual beans using jboss.xml")
<container-configuration>
<container-name>Standard Stateful SessionBean</container-name>
<!--OR
<container-name>Clustered Stateful SessionBean</container-name>
-->
..........
<container-cache-conf>
<cache-policy>org.jboss.ejb.plugins.LRUStatefulContextCachePolicy</cache-policy>
<cache-policy-conf>
...........
<!--This is where you set the maximum bean life in passivated state. Time in seconds -->
<max-bean-life>1800</max-bean-life>

I found info on the jboss config in JBoss 3.0 Deployment and Administration Handbook, written by Meeraj Moidoo Kunnumpurath


Hope it helps.


Alex (SCJP 1.4, SCBCD 1.3, SCWCD 1.4, SCJD 1.4)
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
thank you very much for answer....
Luiz Carlos Silva
Greenhorn

Joined: Nov 08, 2010
Posts: 7
Good afternoon Sr.
I'm have the same problem, where I'm put these settings in my application?
Technologies Used : Gatein, Seam and JSF
Luiz Carlos Silva
Greenhorn

Joined: Nov 08, 2010
Posts: 7
Tranks Srs. Got.
[]'s
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Stateful session bean can not be activate