Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

Stateful session bean can not be activate  RSS feed

 
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ...
 
Ranch Hand
Posts: 209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
somkiat puisungnoen
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you very much for answer....
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tranks Srs. Got.
[]'s
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!