0 Replies Latest reply on Oct 25, 2005 5:18 AM by Xiang Qinxian

    removeSession StatefulRemoveInterceptor

    Xiang Qinxian Newbie

      there is a Exception from seam dvdstore sample undeployed:
      it seems that ctx==null;

      2005-10-24 18:37:50,546 DEBUG [org.jboss.seam.contexts.Lifecycle] destroying session context
      2005-10-24 18:37:50,546 DEBUG [org.jboss.seam.contexts.Contexts] destroying: currentUser
      2005-10-24 18:37:50,546 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.jboss.seam.core.manager.conversationIdActivityMap
      2005-10-24 18:37:50,546 DEBUG [org.jboss.seam.contexts.Contexts] found in application context: cart.component
      2005-10-24 18:37:50,546 DEBUG [org.jboss.seam.contexts.Contexts] destroying: cart
      2005-10-24 18:37:50,546 DEBUG [org.jboss.ejb3.cache.simple.StatefulSessionFilePersistenceManager] Attempting to activate; id=5c4o15x-51u7ek-ef6m1ka9-1-ef6m4fnm-c
      2005-10-24 18:37:50,546 DEBUG [org.jboss.ejb3.cache.simple.StatefulSessionFilePersistenceManager] Reading session state from: F:\jboss-4.0.3SP1\server\default\tmp\sessions\com.jboss.dvd.seam.ShoppingCartBean-ef6m2mym-a\5c4o15x-51u7ek-ef6m1ka9-1-ef6m4fnm-c.ser
      2005-10-24 18:37:50,562 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/dvd]] Session event listener threw exception
      java.lang.NullPointerException
      at org.jboss.ejb3.stateful.StatefulRemoveInterceptor.removeSession(StatefulRemoveInterceptor.java:61)
      at org.jboss.ejb3.stateful.StatefulRemoveInterceptor.invoke(StatefulRemoveInterceptor.java:46)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
      at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:63)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
      at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:32)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
      at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:91)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
      at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:150)
      at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:83)
      at $Proxy116.destroy(Unknown Source)
      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(Unknown Source)
      at org.jboss.seam.util.Reflections.invokeAndWrap(Unknown Source)
      at org.jboss.seam.contexts.Contexts.callDestroyMethod(Unknown Source)
      at org.jboss.seam.contexts.Contexts.destroy(Unknown Source)
      at org.jboss.seam.contexts.Lifecycle.endSession(Unknown Source)
      at org.jboss.seam.servlet.SeamListener.sessionDestroyed(Unknown Source)
      at org.apache.catalina.session.StandardSession.expire(StandardSession.java:675)
      at org.apache.catalina.session.StandardSession.expire(StandardSession.java:633)
      at org.apache.catalina.session.StandardManager.stop(StandardManager.java:676)
      at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4255)
      at org.apache.catalina.core.ContainerBase.destroy(ContainerBase.java:1131)
      at org.apache.catalina.core.StandardContext.destroy(StandardContext.java:4358)
      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.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
      at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:150)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.web.tomcat.tc5.TomcatDeployer.performUndeployInternal(TomcatDeployer.java:424)
      at org.jboss.web.tomcat.tc5.TomcatDeployer.performUndeploy(TomcatDeployer.java:395)
      at org.jboss.web.AbstractWebDeployer.stop(AbstractWebDeployer.java:404)
      at org.jboss.web.WebModule.stopModule(WebModule.java:85)
      at org.jboss.web.WebModule.stopService(WebModule.java:51)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStop(ServiceMBeanSupport.java:300)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:232)
      at sun.reflect.GeneratedMethodAccessor2.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:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:943)
      at $Proxy0.stop(Unknown Source)
      at org.jboss.system.ServiceController.stop(ServiceController.java:519)
      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:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy33.stop(Unknown Source)
      at org.jboss.web.AbstractWebContainer.stop(AbstractWebContainer.java:432)
      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:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
      at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy34.stop(Unknown Source)
      at org.jboss.deployment.MainDeployer.stop(MainDeployer.java:640)
      at org.jboss.deployment.MainDeployer.stop(MainDeployer.java:632)
      at org.jboss.deployment.MainDeployer.undeploy(MainDeployer.java:613)
      at org.jboss.deployment.MainDeployer.shutdown(MainDeployer.java:500)
      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:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.system.server.ServerImpl$ShutdownHook.shutdownDeployments(ServerImpl.java:988)
      at org.jboss.system.server.ServerImpl$ShutdownHook.shutdown(ServerImpl.java:963)
      at org.jboss.system.server.ServerImpl$ShutdownHook.run(ServerImpl.java:941)
      2005-10-24 18:37:50,953 DEBUG [org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread] Shutdown

      protected void removeSession(Invocation invocation)
       {
       StatefulContainerInvocation ejb = (StatefulContainerInvocation) invocation;
       Object id = ejb.getId();
       StatefulContainer container = (StatefulContainer) ejb.getAdvisor();
       StatefulBeanContext ctx = (StatefulBeanContext) ejb.getBeanContext();
       container.getCache().remove(id);
       ExtendedPersistenceContext session = (ExtendedPersistenceContext) ctx.getMetaData().getMetaData(ManagedEntityManagerFactory.LONG_LIVED_SESSION, ManagedEntityManagerFactory.LONG_LIVED_SESSION);
       if (session != null)
       {
       log.debug("REMOVING EXTENDED PERSISTENCE CONTEXT");
       session.closeExtendedPersistenceContext();
       }
       }