[jboss-user] [JBoss Seam] - Re: Excessive [could not destroy component] 1.1B1 to 1.1CR1
lowecg2004
do-not-reply at jboss.com
Mon Dec 4 03:44:12 EST 2006
I had created this quick setup guide for our developers based on the information in this thread:
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=93589
I hope this helps you out.
Chris.
There are a few important timeout values in the Seam environment that any Seam developer needs to be aware of.
The first one is obvious and it is the well known HTTP session-timeout value (the one that you set in web.xml). What catches most people out is that there also is a separate EJB3 SFSB timeout value. These SFSB timeout values must be set in 2 places.
Since Seam freely integrates these two environments, a difference in the two timeouts can cause apparently random exceptions like:
19:23:07,124 WARN [Contexts] Could not destroy component: login
| 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:8
| 7)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.jav
| a:77)
| ...
It is worth mentioning that there is a @CacheConfig annotation that allows you to specify the SFSB timeout on a per class basis. This offers a fine grained level of control, however you often just need to set the value once and have done with it. So in order to align the HTTP session and the SFSB timeouts, you must amend configuration files. Also note that this example sets these values to be exactly the same. It is sometimes recommended that the SFSB timeouts are set to be longer than the HTTP session timeout.
1. HTTP Session Timeout
File: WEB-INF/web.xml
<session-config>
| <session-timeout>15</session-timeout>
| </session-config>
Note: Value is in minutes;
2. SFSB Timeout Part 1
File: PROJECT_HOME/embedded-ejb/conf/ejb3-interceptors-aop.xml
Find entry matching 'domain name="Stateful Bean" extends="Base Stateful Bean" inheritBindings="true">':
<domain name="Stateful Bean" extends="Base Stateful Bean" inheritBindings="true">
| ...
| <!-- OCSS: Align this value with session timeout in web.xml -->
| <annotation expr="!class(@org.jboss.annotation.ejb.cache.simple.CacheConfig) AND !class(@org.jboss.annotation.ejb.Clustered)">
| @org.jboss.annotation.ejb.cache.simple.CacheConfig (maxSize=100000, idleTimeoutSeconds=900)
| </annotation>
Set the idleTimeoutSeconds value.
Note: Value is in seconds;
3. SFSB Timeout Part 2
File: JBOSS_HOME\server\default\conf\standardjboss.xml
Find entry for '<container-name>Standard Stateful SessionBean</container-name>':
| <container-configuration>
| <container-name>Standard Stateful SessionBean</container-name>
| ...
| <container-cache-conf>
| ...
| <cache-policy-conf>
| <remover-period>900</remover-period>
| <max-bean-life>900</max-bean-life>
| ...
Note: Value is in seconds; Also this config is required for every server that the Seam code is deployed to.
That is all. Aligning these three timeout values will prevent those "Could not destroy component: XXXX" exceptions and prevent some strange behaviour in your apps.
Further information and discussion, see the thread referenced at the start of this post.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3990903#3990903
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3990903
More information about the jboss-user
mailing list