[
https://jira.jboss.org/jira/browse/JBSEAM-1707?page=com.atlassian.jira.pl...
]
Shane Bryzak updated JBSEAM-1707:
---------------------------------
Fix Version/s: The future
(was: 2.1.0.CR1)
@Destroy method on APPLICATION scope bean throws IllegalState(no
context) at server stop time
---------------------------------------------------------------------------------------------
Key: JBSEAM-1707
URL:
https://jira.jboss.org/jira/browse/JBSEAM-1707
Project: Seam
Issue Type: Bug
Components: Core
Affects Versions: 2.0.0.BETA1
Environment: Tomcat 6.0.10, JavaBean mode, Hibernate 3.2.3, HBEM 3.3.1
Reporter: Frits Jalvingh
Fix For: The future
I have a bean defined as follows:
@Name("initBean")
@Startup()
@Scope(ScopeType.APPLICATION)
public class InitBean {
containing a method:
@Destroy
public void destroy() {
Builder.getInstance().terminate();
BuildBot.getInstance().stop();
}
It is meant to shutdown some daemons when the server stops.
When the server stops I get an exception:
01:15:39,703 WARN [Component] Exception calling component @Destroy method: initBean
java.lang.IllegalStateException: no event context active
at org.jboss.seam.web.ServletContexts.instance(ServletContexts.java:40)
at org.jboss.seam.web.Parameters.getRequestParameters(Parameters.java:39)
at org.jboss.seam.faces.Parameters.getRequestParameters(Parameters.java:64)
at org.jboss.seam.Component.injectParameters(Component.java:1334)
at org.jboss.seam.Component.inject(Component.java:1304)
at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:45)
at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at
org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
at
org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:151)
at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:87)
at to.etc.saram.beans.InitBean_$$_javassist_0.destroy(InitBean_$$_javassist_0.java)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:124)
at org.jboss.seam.Component.callComponentMethod(Component.java:1957)
at org.jboss.seam.Component.callDestroyMethod(Component.java:1888)
at org.jboss.seam.Component.destroy(Component.java:1217)
at org.jboss.seam.contexts.Contexts.destroy(Contexts.java:251)
at org.jboss.seam.contexts.Lifecycle.endApplication(Lifecycle.java:52)
at org.jboss.seam.contexts.ServletLifecycle.endApplication(ServletLifecycle.java:121)
at org.jboss.seam.servlet.SeamListener.contextDestroyed(SeamListener.java:39)
at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:3866)
at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4502)
at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1068)
at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1068)
at org.apache.catalina.core.StandardEngine.stop(StandardEngine.java:448)
at org.apache.catalina.core.StandardService.stop(StandardService.java:510)
at org.apache.catalina.core.StandardServer.stop(StandardServer.java:744)
at org.apache.catalina.startup.Catalina.stop(Catalina.java:602)
at org.apache.catalina.startup.Catalina.start(Catalina.java:577)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
which seems to be caused by the bean Injector trying to access the request context which
of course is no longer there. The bean contains only a single injected thingy which is the
entityManager.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira