0 Replies Latest reply on Dec 16, 2008 1:58 AM by Stephen Friedrich

    In plain Tomcat @Destroy fails for application scoped components?!

    Stephen Friedrich Novice

      It seems that @Destroy methods on application scoped components do not work at all in plain Tomcat.
      My code used to work fine with embedded jboss, but I can't use that in our environment.


      Now in plain Tomcat this is what I get on shutdown and the logic in the destroy method never executes:



      2008-12-16 01:44:48,996 WARN  [Component] Exception calling component @Destroy method: contentManager
      java.lang.IllegalStateException: No event context active
              at org.jboss.seam.ScopeType.getContext(ScopeType.java:121)
              at org.jboss.seam.Component.getInstance(Component.java:1966)
              at org.jboss.seam.Component.getInstance(Component.java:1961)
              at org.jboss.seam.Component.getInstance(Component.java:1934)
              at org.jboss.seam.Component.getInstance(Component.java:1929)
              at org.jboss.seam.transaction.Transaction.instance(Transaction.java:36)
              at org.jboss.seam.util.Work.workInTransaction(Work.java:32)
              at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:89)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
              at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
              at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
              at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
              at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
              at com.acme.beans.ContentManager_$$_javassist_2.destroy(ContentManager_$$_javassist_2.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:22)
              at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
              at org.jboss.seam.Component.callComponentMethod(Component.java:2211)
              at org.jboss.seam.Component.callDestroyMethod(Component.java:2142)
              at org.jboss.seam.Component.destroy(Component.java:1436)
              at org.jboss.seam.contexts.Contexts.destroy(Contexts.java:251)
              at org.jboss.seam.contexts.Lifecycle.endApplication(Lifecycle.java:56)
              at org.jboss.seam.contexts.ServletLifecycle.endApplication(ServletLifecycle.java:135)
              at org.jboss.seam.servlet.SeamListener.contextDestroyed(SeamListener.java:40)
              at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:3805)
              at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4364)
              at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:893)
              at org.apache.catalina.startup.HostConfig.undeployApps(HostConfig.java:1192)
              at org.apache.catalina.startup.HostConfig.stop(HostConfig.java:1163)
              at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:313)
              at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
              at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1055)
              at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1067)
              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:734)
              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:295)
              at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)



      Is it working for somebody else? Any advice?