glassfish
  1. glassfish
  2. GLASSFISH-21095

No active contexts for scope type javax.transaction.TransactionScoped

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.1_b07
    • Fix Version/s: 4.1_b08
    • Component/s: jms
    • Labels:
      None
    • Environment:

      Java 1.8.0_05-b13 - OS X (Mavericks)

      Description

      The jms/websimplemessage sample of the Java EE 7 tutorial works fine on GF4.0 (b89) but throws the following exception on GF4.0.1 : WELD-001303: No active contexts for scope type javax.transaction.TransactionScoped

      https://svn.java.net/svn/javaeetutorial~svn/branches/javaee-tutorial-7.0.4/examples/jms/websimplemessage/

      Here is the stack trace. Initializing the messageText value makes no difference.

      Severe: Error Rendering View[/sender.xhtml]
      javax.el.ELException: /sender.xhtml @30,38 value="#

      {senderBean.messageText}

      ": org.jboss.weld.context.ContextNotActiveException: WELD-001303: No active contexts for scope type javax.transaction.TransactionScoped
      at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:114)
      at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194)
      at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:182)
      at javax.faces.component.UIOutput.getValue(UIOutput.java:174)
      at javax.faces.component.UIInput.getValue(UIInput.java:291)
      at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:205)
      at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:355)
      at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:164)
      at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1864)
      at javax.faces.render.Renderer.encodeChildren(Renderer.java:176)
      at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:889)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1857)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1860)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1860)
      at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:461)
      at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:133)
      at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337)
      at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647)
      at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
      at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
      at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:415)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:282)
      at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
      at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
      at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)
      at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
      at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
      at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
      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:561)
      at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
      at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
      at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
      at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
      at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
      at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
      at java.lang.Thread.run(Thread.java:744)
      Caused by: javax.el.ELException: org.jboss.weld.context.ContextNotActiveException: WELD-001303: No active contexts for scope type javax.transaction.TransactionScoped
      at javax.el.BeanELResolver.getValue(BeanELResolver.java:368)
      at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
      at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
      at com.sun.el.parser.AstValue.getValue(AstValue.java:140)
      at com.sun.el.parser.AstValue.getValue(AstValue.java:204)
      at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:226)
      at org.jboss.weld.el.WeldValueExpression.getValue(WeldValueExpression.java:50)
      at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109)
      ... 49 more
      Caused by: org.jboss.weld.context.ContextNotActiveException: WELD-001303: No active contexts for scope type javax.transaction.TransactionScoped
      at org.jboss.weld.manager.BeanManagerImpl.getContext(BeanManagerImpl.java:687)
      at org.jboss.weld.manager.BeanManagerImpl.getInjectableReference(BeanManagerImpl.java:825)
      at org.jboss.weld.injection.ParameterInjectionPointImpl.getValueToInject(ParameterInjectionPointImpl.java:76)
      at org.jboss.weld.injection.ConstructorInjectionPoint.getParameterValues(ConstructorInjectionPoint.java:141)
      at org.jboss.weld.injection.ConstructorInjectionPoint.newInstance(ConstructorInjectionPoint.java:71)
      at org.jboss.weld.injection.producer.AbstractInstantiator.newInstance(AbstractInstantiator.java:28)
      at org.jboss.weld.injection.producer.BasicInjectionTarget.produce(BasicInjectionTarget.java:104)
      at org.jboss.weld.injection.producer.BeanInjectionTarget.produce(BeanInjectionTarget.java:190)
      at org.glassfish.jms.injection.JMSCDIExtension$LocalPassivationCapableBean.create(JMSCDIExtension.java:208)
      at org.jboss.weld.context.unbound.DependentContextImpl.get(DependentContextImpl.java:69)
      at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:740)
      at org.jboss.weld.manager.BeanManagerImpl.getInjectableReference(BeanManagerImpl.java:831)
      at org.jboss.weld.injection.FieldInjectionPoint.inject(FieldInjectionPoint.java:92)
      at org.jboss.weld.util.Beans.injectBoundFields(Beans.java:364)
      at org.jboss.weld.util.Beans.injectFieldsAndInitializers(Beans.java:375)
      at org.jboss.weld.injection.producer.DefaultInjector$1.proceed(DefaultInjector.java:71)
      at org.glassfish.weld.services.InjectionServicesImpl.aroundInject(InjectionServicesImpl.java:150)
      at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:46)
      at org.jboss.weld.injection.producer.DefaultInjector.inject(DefaultInjector.java:68)
      at org.jboss.weld.injection.producer.ResourceInjector.access$101(ResourceInjector.java:46)
      at org.jboss.weld.injection.producer.ResourceInjector$1.proceed(ResourceInjector.java:70)
      at org.glassfish.weld.services.InjectionServicesImpl.aroundInject(InjectionServicesImpl.java:150)
      at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:46)
      at org.jboss.weld.injection.producer.ResourceInjector.inject(ResourceInjector.java:65)
      at org.jboss.weld.injection.producer.BasicInjectionTarget.inject(BasicInjectionTarget.java:109)
      at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:150)
      at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:96)
      at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:98)
      at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:78)
      at org.jboss.weldeetutorial.websimplemessage.SenderBean$Proxy$_$$_WeldClientProxy.getMessageText(Unknown Source)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:483)
      at javax.el.BeanELResolver.getValue(BeanELResolver.java:363)
      ... 56 more

      Warning: StandardWrapperValve[Faces Servlet]: Servlet.service() for servlet Faces Servlet threw exception
      org.jboss.weld.context.ContextNotActiveException: WELD-001303: No active contexts for scope type javax.transaction.TransactionScoped
      at org.jboss.weld.manager.BeanManagerImpl.getContext(BeanManagerImpl.java:687)
      at org.jboss.weld.manager.BeanManagerImpl.getInjectableReference(BeanManagerImpl.java:825)
      at org.jboss.weld.injection.ParameterInjectionPointImpl.getValueToInject(ParameterInjectionPointImpl.java:76)
      at org.jboss.weld.injection.ConstructorInjectionPoint.getParameterValues(ConstructorInjectionPoint.java:141)
      at org.jboss.weld.injection.ConstructorInjectionPoint.newInstance(ConstructorInjectionPoint.java:71)
      at org.jboss.weld.injection.producer.AbstractInstantiator.newInstance(AbstractInstantiator.java:28)
      at org.jboss.weld.injection.producer.BasicInjectionTarget.produce(BasicInjectionTarget.java:104)
      at org.jboss.weld.injection.producer.BeanInjectionTarget.produce(BeanInjectionTarget.java:190)
      at org.glassfish.jms.injection.JMSCDIExtension$LocalPassivationCapableBean.create(JMSCDIExtension.java:208)
      at org.jboss.weld.context.unbound.DependentContextImpl.get(DependentContextImpl.java:69)
      at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:740)
      at org.jboss.weld.manager.BeanManagerImpl.getInjectableReference(BeanManagerImpl.java:831)
      at org.jboss.weld.injection.FieldInjectionPoint.inject(FieldInjectionPoint.java:92)
      at org.jboss.weld.util.Beans.injectBoundFields(Beans.java:364)
      at org.jboss.weld.util.Beans.injectFieldsAndInitializers(Beans.java:375)
      at org.jboss.weld.injection.producer.DefaultInjector$1.proceed(DefaultInjector.java:71)
      at org.glassfish.weld.services.InjectionServicesImpl.aroundInject(InjectionServicesImpl.java:150)
      at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:46)
      at org.jboss.weld.injection.producer.DefaultInjector.inject(DefaultInjector.java:68)
      at org.jboss.weld.injection.producer.ResourceInjector.access$101(ResourceInjector.java:46)
      at org.jboss.weld.injection.producer.ResourceInjector$1.proceed(ResourceInjector.java:70)
      at org.glassfish.weld.services.InjectionServicesImpl.aroundInject(InjectionServicesImpl.java:150)
      at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:46)
      at org.jboss.weld.injection.producer.ResourceInjector.inject(ResourceInjector.java:65)
      at org.jboss.weld.injection.producer.BasicInjectionTarget.inject(BasicInjectionTarget.java:109)
      at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:150)
      at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:96)
      at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:98)
      at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:78)
      at org.jboss.weldeetutorial.websimplemessage.SenderBean$Proxy$_$$_WeldClientProxy.getMessageText(Unknown Source)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:483)
      at javax.el.BeanELResolver.getValue(BeanELResolver.java:363)
      at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
      at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
      at com.sun.el.parser.AstValue.getValue(AstValue.java:140)
      at com.sun.el.parser.AstValue.getValue(AstValue.java:204)
      at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:226)
      at org.jboss.weld.el.WeldValueExpression.getValue(WeldValueExpression.java:50)
      at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109)
      at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194)
      at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:182)
      at javax.faces.component.UIOutput.getValue(UIOutput.java:174)
      at javax.faces.component.UIInput.getValue(UIInput.java:291)
      at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:205)
      at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:355)
      at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:164)
      at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1864)
      at javax.faces.render.Renderer.encodeChildren(Renderer.java:176)
      at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:889)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1857)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1860)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1860)
      at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:461)
      at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:133)
      at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337)
      at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647)
      at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
      at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
      at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:415)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:282)
      at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
      at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
      at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)
      at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
      at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
      at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
      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:561)
      at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
      at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
      at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
      at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
      at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
      at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
      at java.lang.Thread.run(Thread.java:744)

        Activity

        Hide
        jjsnyder83 added a comment -

        This is a bug in Weld. I've sent them an email describing the problem.

        Show
        jjsnyder83 added a comment - This is a bug in Weld. I've sent them an email describing the problem.
        Hide
        jjsnyder83 added a comment -

        It turns out that this is not a bug but a change in Weld behavior. A client proxy for a normal scoped bean being initialized lazily is not standardized (see also
        https://issues.jboss.org/browse/CDI-125). So applications/extensions should not rely on it. Since 2.2.1.Final weld has introduced some optimizations (see also
        https://issues.jboss.org/browse/WELD-1659, it's based on the spec, section "6.5.5. Injectable references").

        Basically, Weld does not inject a client proxy if the bean upon which to perform injection is @RequestScoped or if both this bean and the bean to be injected are @ApplicationScoped. In this case, SenderBean is @RequestScoped and therefore Weld injects a contextual instance.

        InjectableJMSContext could use javax.enterprise.inject.Instance<T> to obtain an instance of TransactedJMSContextManager dynamically.

        Show
        jjsnyder83 added a comment - It turns out that this is not a bug but a change in Weld behavior. A client proxy for a normal scoped bean being initialized lazily is not standardized (see also https://issues.jboss.org/browse/CDI-125 ). So applications/extensions should not rely on it. Since 2.2.1.Final weld has introduced some optimizations (see also https://issues.jboss.org/browse/WELD-1659 , it's based on the spec, section "6.5.5. Injectable references"). Basically, Weld does not inject a client proxy if the bean upon which to perform injection is @RequestScoped or if both this bean and the bean to be injected are @ApplicationScoped. In this case, SenderBean is @RequestScoped and therefore Weld injects a contextual instance. InjectableJMSContext could use javax.enterprise.inject.Instance<T> to obtain an instance of TransactedJMSContextManager dynamically.
        Hide
        David Zhao added a comment -

        This is fixed by change# 63408

        Show
        David Zhao added a comment - This is fixed by change# 63408
        Hide
        David Delabassee added a comment -

        Tested on b208, the sample works now as expected.

        Show
        David Delabassee added a comment - Tested on b208, the sample works now as expected.

          People

          • Assignee:
            David Zhao
            Reporter:
            David Delabassee
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: