glassfish
  1. glassfish
  2. GLASSFISH-19083

org.jboss.weld.context.ContextNotActiveException is thrown when undeploying application.

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Invalid
    • Affects Version/s: 4.0_b53
    • Fix Version/s: 4.0
    • Component/s: cdi
    • Labels:
      None

      Description

      There are 2 beans A and B. A is dependent scoped and B is request scoped. B is injected into A. A is injected into an EJB.

      To reproduce, please refer to the attached netbean project.

      1. Build and deploy the ear.
      2. Access the NewServlet via browser for initializing an EJB instance.
      3. Undeploy the application to trigger bean A's preDestroy method. Then we can see the following exception.

      [#|2012-09-17T15:03:12.609+0800|INFO|44.0|javax.enterprise.system.tools.admin.org.glassfish.deployment.admin|_ThreadID=13;_ThreadName=admin-listener(2);|EnterpriseApplication1 was successfully deployed in 785 milliseconds.|#]

      [#|2012-09-17T15:03:16.706+0800|INFO|44.0|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=24;_ThreadName=http-listener-1(2);|B.xyz() is called.|#]

      [#|2012-09-17T15:03:36.931+0800|INFO|44.0|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=13;_ThreadName=admin-listener(2);|A is closing...|#]

      [#|2012-09-17T15:03:36.933+0800|SEVERE|44.0|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=13;_ThreadName=admin-listener(2);|org.jboss.weld.context.ContextNotActiveException: WELD-001303 No active contexts for scope type javax.enterprise.context.RequestScoped
      at org.jboss.weld.manager.BeanManagerImpl.getContext(BeanManagerImpl.java:598)
      at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:71)
      at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:79)
      at test.B$Proxy$$$_WeldClientProxy.close(B$Proxy$$$_WeldClientProxy.java)
      at test.A.cleanup(A.java:28)
      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:597)
      at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:264)
      at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52)
      at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:137)
      at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:260)
      at org.jboss.weld.introspector.jlr.WeldMethodImpl.invoke(WeldMethodImpl.java:174)
      at org.jboss.weld.bean.AbstractClassBean.defaultPreDestroy(AbstractClassBean.java:493)
      at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget.preDestroy(ManagedBean.java:182)
      at org.jboss.weld.bean.ManagedBean.destroy(ManagedBean.java:302)
      at org.jboss.weld.context.ForwardingContextual.destroy(ForwardingContextual.java:31)
      at org.jboss.weld.context.CreationalContextImpl.destroy(CreationalContextImpl.java:100)
      at org.jboss.weld.context.CreationalContextImpl.release(CreationalContextImpl.java:92)
      at org.jboss.weld.context.CreationalContextImpl.release(CreationalContextImpl.java:83)
      at org.glassfish.weld.services.JCDIServiceImpl$JCDIInjectionContextImpl.cleanup(JCDIServiceImpl.java:318)
      at com.sun.ejb.containers.BaseContainer.cleanupInstance(BaseContainer.java:1704)
      at com.sun.ejb.containers.StatelessSessionContainer$SessionContextFactory.destroy(StatelessSessionContainer.java:779)
      at com.sun.ejb.containers.util.pool.NonBlockingPool.close(NonBlockingPool.java:417)
      at com.sun.ejb.containers.StatelessSessionContainer.doConcreteContainerShutdown(StatelessSessionContainer.java:709)
      at com.sun.ejb.containers.BaseContainer.undeploy(BaseContainer.java:4163)
      at org.glassfish.ejb.startup.EjbApplication.stop(EjbApplication.java:297)
      at org.glassfish.internal.data.EngineRef.stop(EngineRef.java:161)
      at org.glassfish.internal.data.ModuleInfo.stop(ModuleInfo.java:311)
      at org.glassfish.internal.data.ApplicationInfo.stop(ApplicationInfo.java:327)
      at com.sun.enterprise.v3.server.ApplicationLifecycle.unload(ApplicationLifecycle.java:1051)
      at com.sun.enterprise.v3.server.ApplicationLifecycle.undeploy(ApplicationLifecycle.java:1091)
      at org.glassfish.deployment.admin.UndeployCommand.execute(UndeployCommand.java:399)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:529)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:550)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1430)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1600(CommandRunnerImpl.java:114)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1734)
      at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1683)
      at org.glassfish.admin.rest.resources.admin.CommandResource.executeCommand(CommandResource.java:467)
      at org.glassfish.admin.rest.resources.admin.CommandResource.execCommandSimpInMultOut(CommandResource.java:255)
      at sun.reflect.GeneratedMethodAccessor117.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.glassfish.jersey.server.model.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:80)
      at org.glassfish.jersey.server.model.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:113)
      at org.glassfish.jersey.server.model.AbstractJavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(AbstractJavaResourceMethodDispatcherProvider.java:176)
      at org.glassfish.jersey.server.model.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:79)
      at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:268)
      at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:84)
      at org.glassfish.jersey.process.internal.RequestInvoker$AcceptingInvoker.apply(RequestInvoker.java:241)
      at org.glassfish.jersey.process.internal.AsyncInflectorAdapter.apply(AsyncInflectorAdapter.java:157)
      at org.glassfish.jersey.process.internal.RequestInvoker$2.run(RequestInvoker.java:188)
      at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:309)
      at org.glassfish.jersey.process.internal.RequestInvoker$3.run(RequestInvoker.java:201)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:262)
      at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:43)
      at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:40)
      at org.glassfish.jersey.process.internal.RequestInvoker.apply(RequestInvoker.java:197)
      at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:758)
      at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:298)
      at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:205)
      at com.sun.enterprise.v3.server.HK2Dispatcher.dispatch(HK2Dispatcher.java:113)
      at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:236)
      at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:164)
      at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:175)
      at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:265)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:134)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
      at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
      at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:825)
      at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
      at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
      at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
      at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
      at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:578)
      at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:558)
      at java.lang.Thread.run(Thread.java:662)

      #]

        Activity

          People

          • Assignee:
            arjavdesai
            Reporter:
            David Zhao
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: