1 Reply Latest reply on Oct 28, 2007 6:24 AM by Pete Muir

    MDB as Seam Component yields an Exception on Shutdown

    Gerhard Balthasar Newbie

      Hi!

      I'm using a simple Message Driven Bean (code doesn't matter) on a Queue as Seam (2.0Beta1) Component. While JBoss 4.2 is running, everything runs fine and works as expected.

      But on shutdown, JBoss shows following exception but only if my MDB has been used while runtime. If not, no exception is being shown.

      16:44:58,140 INFO [Server] JBoss SHUTDOWN: Undeploying all packages
      16:44:58,312 WARN [JmxKernelAbstraction] jboss.j2ee:ear=Seam.ear,jar=jboss-seam.jar,name=TimerServiceDispatcher,service=EJB3 is not registered
      16:44:58,312 WARN [JmxKernelAbstraction] jboss.j2ee:ear=Seam.ear,jar=jboss-seam.jar,name=EjbSynchronizations,service=EJB3 is not registered
      16:44:58,359 WARN [JmxKernelAbstraction] jboss.j2ee:ear=Seam.ear,jar=Seam.jar,name=DocumentAction,service=EJB3 is not registered
      16:44:58,359 WARN [JmxKernelAbstraction] jboss.j2ee:ear=Seam.ear,jar=Seam.jar,name=PaperAction,service=EJB3 is not registered
      16:44:58,390 WARN [JmxKernelAbstraction] jboss.j2ee:ear=Seam.ear,jar=Seam.jar,name=TemplateAction,service=EJB3 is not registered
      16:44:58,406 WARN [JmxKernelAbstraction] jboss.j2ee:ear=Seam.ear,jar=Seam.jar,name=PaperMessage,service=EJB3 is not registered
      16:44:58,406 WARN [JmxKernelAbstraction] jboss.j2ee:ear=Seam.ear,jar=Seam.jar,name=PatternMessage,service=EJB3 is not registered
      16:44:58,406 WARN [JmxKernelAbstraction] jboss.j2ee:ear=Seam.ear,jar=Seam.jar,name=PenServerMessage,service=EJB3 is not registered
      16:44:58,406 WARN [MdbDelegateWrapper] Stopping failed jboss.j2ee:ear=Seam.ear,jar=Seam.jar,name=TemplateMessage,service=EJB3
      java.lang.RuntimeException: java.lang.IllegalStateException: Attempted to invoke a Seam component outside the an initialized application
       at org.jboss.ejb3.interceptor.LifecycleInterceptorHandler.preDestroy(LifecycleInterceptorHandler.java:135)
       at org.jboss.ejb3.EJBContainer.invokePreDestroy(EJBContainer.java:621)
       at org.jboss.ejb3.AbstractPool.remove(AbstractPool.java:207)
       at org.jboss.ejb3.AbstractPool.discard(AbstractPool.java:218)
       at org.jboss.ejb3.StrictMaxPool.discard(StrictMaxPool.java:243)
       at org.jboss.ejb3.StrictMaxPool.freeAll(StrictMaxPool.java:269)
       at org.jboss.ejb3.StrictMaxPool.destroy(StrictMaxPool.java:226)
       at org.jboss.ejb3.EJBContainer.stop(EJBContainer.java:589)
       at org.jboss.ejb3.mdb.MessagingContainer.stop(MessagingContainer.java:292)
       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.ejb3.ServiceDelegateWrapper.stopService(ServiceDelegateWrapper.java:119)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalStop(ServiceMBeanSupport.java:315)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:247)
       at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
       at $Proxy0.stop(Unknown Source)
       at org.jboss.system.ServiceController.stop(ServiceController.java:508)
       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.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy57.stop(Unknown Source)
       at org.jboss.ejb3.JmxKernelAbstraction.uninstallMBean(JmxKernelAbstraction.java:175)
       at org.jboss.ejb3.JmxKernelAbstraction.uninstall(JmxKernelAbstraction.java:202)
       at org.jboss.ejb3.Ejb3Deployment.stop(Ejb3Deployment.java:585)
       at org.jboss.ejb3.Ejb3Module.stopService(Ejb3Module.java:107)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalStop(ServiceMBeanSupport.java:315)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:247)
       at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
       at $Proxy0.stop(Unknown Source)
       at org.jboss.system.ServiceController.stop(ServiceController.java:508)
       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.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy33.stop(Unknown Source)
       at org.jboss.ejb3.EJB3Deployer.stop(EJB3Deployer.java:532)
       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.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
       at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
       at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
       at org.jboss.ws.integration.jboss42.DeployerInterceptor.stop(DeployerInterceptor.java:111)
       at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.stop(SubDeployerInterceptorSupport.java:196)
       at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:99)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy34.stop(Unknown Source)
       at org.jboss.deployment.MainDeployer.stop(MainDeployer.java:667)
       at org.jboss.deployment.MainDeployer.stop(MainDeployer.java:659)
       at org.jboss.deployment.MainDeployer.undeploy(MainDeployer.java:638)
       at org.jboss.deployment.MainDeployer.shutdown(MainDeployer.java:516)
       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.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.system.server.ServerImpl$ShutdownHook.shutdownDeployments(ServerImpl.java:1058)
       at org.jboss.system.server.ServerImpl$ShutdownHook.shutdown(ServerImpl.java:1033)
       at org.jboss.system.server.ServerImpl$ShutdownHook.run(ServerImpl.java:996)
      Caused by: java.lang.IllegalStateException: Attempted to invoke a Seam component outside the an initialized application
       at org.jboss.seam.contexts.Lifecycle.getApplication(Lifecycle.java:36)
       at org.jboss.seam.contexts.Lifecycle.beginCall(Lifecycle.java:84)
       at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:113)
       at org.jboss.seam.intercept.RootInterceptor.invokeAndHandle(RootInterceptor.java:84)
       at org.jboss.seam.intercept.SessionBeanInterceptor.preDestroy(SessionBeanInterceptor.java:68)
       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.ejb3.interceptor.LifecycleInvocationContextImpl.proceed(LifecycleInvocationContextImpl.java:131)
       at org.jboss.ejb3.interceptor.LifecycleInterceptorHandler.preDestroy(LifecycleInterceptorHandler.java:131)
       ... 104 more
      16:44:58,421 WARN [JmxKernelAbstraction] jboss.j2ee:ear=...
      


      Well, cause is pretty obvious, but what to do against em?

      Thank you in advance,

      Greetz GHad