SFSB timeout setting
ci Oct 30, 2006 4:15 AMHello!
I am using JBoss 4.0.5.GA and Seam 1.1.
I permanently get exceptions like that:
19:23:07,124 WARN [Contexts] Could not destroy component: clientEditor javax.ejb.EJBNoSuchObjectException: Could not find Stateful bean: 5r4m5v-man6m0-etofwmzy-1-etog131z-g at org.jboss.ejb3.cache.simple.SimpleStatefulCache.get(SimpleStatefulCache.java:268) at org.jboss.ejb3.stateful.StatefulRemoveInterceptor.removeSession(StatefulRemoveInterceptor.java:127) at org.jboss.ejb3.stateful.StatefulRemoveInterceptor.invoke(StatefulRemoveInterceptor.java:87) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101) at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77) ... at java.lang.reflect.Method.invoke(Method.java:585) at org.jboss.seam.util.Reflections.invoke(Reflections.java:33) at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:201) at org.jboss.seam.Component.callComponentMethod(Component.java:1647) at org.jboss.seam.Component.callDestroyMethod(Component.java:1603) at org.jboss.seam.contexts.Contexts.destroy(Contexts.java:371) at org.jboss.seam.contexts.Lifecycle.endSession(Lifecycle.java:218) at org.jboss.seam.servlet.SeamListener.sessionDestroyed(SeamListener.java:89) at org.apache.catalina.session.StandardSession.expire(StandardSession.java:687) at org.apache.catalina.session.StandardSession.isValid(StandardSession.java:579) at org.apache.catalina.session.ManagerBase.processExpires(ManagerBase.java:678) at org.apache.catalina.session.ManagerBase.backgroundProcess(ManagerBase.java:663) at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1284)
In Seam forum they told that one has to use @CacheConfig and set it to the value greater that http session timeout. Http session dies by default after 30 minutes, so CacheConfig should be set to 1800.
Http session timeout can be set from web.xml, say, in one place. I want to set @CacheConfig also in one place and not in every bean. I found
<max-bean-life>1800</max-bean-life>
in standardjboss.xml, but it seems not to work (timeout 300 below):
18:36:37,610 INFO [NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces} 18:36:37,845 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=qwerty.ear,jar=qwerty.jar,name=UploadAction,service=EJB3 with dependencies: 18:36:37,892 INFO [EJBContainer] STARTED EJB: qwerty.fileupload.UploadAction ejbName: UploadAction 18:36:37,970 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=qwerty.ear,jar=qwerty.jar,name=CategoryVacanciesBean,service=EJB3 with dependencies: 18:36:38,017 INFO [EJBContainer] STARTED EJB: qwerty.actions.CategoryVacanciesBean ejbName: CategoryVacanciesBean 18:36:38,095 INFO [SimpleStatefulCache] Initializing SimpleStatefulCache with maxSize: 100000 timeout: 300 for jboss.j2ee:ear=qwerty.ear,jar=qwerty.jar,name=CategoryVacanciesBean,service=EJB3
More, it seems that nobody looks in xml file any more:
public @interface CacheConfig { int maxSize() default 100000; long idleTimeoutSeconds() default 300; } ... sessionTimeout = config.idleTimeoutSeconds(); ...
I do not know whether it is a bug or not...
Please, advise, how to set SFSB timeout correctly in xml (not through annotations) for all SFSB beans in ear?
By the way, can I control a timeout when a bean is passivated? And how can I list all instantiated/passivated/alive SFSB (through jmx-console, I suppose, but I cannot find where...)?
Thank you in advance.