0 Replies Latest reply on Jun 20, 2012 11:53 AM by Thomas Goettlich

    ContextNotActiveException during EJB call from MBean

    Thomas Goettlich Novice

      Hi,

       

      in a JBoss 7.1.0.Final environment we have an MBean that is managed by CDI and gets some EJB injected.

      The MBean then calls the EJB which itself gets a request scoped CDI bean's proxy injected.

       

      However, once the EJB accesses that CDI proxy, we get the following exception:

       

         ...

      Caused by: 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) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]

              at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:71) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]

              at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:79) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]

              at de.itinformatik.zoeppritz.common.api.logic.ZoeValidFlagTracker$Proxy$_$$_WeldClientProxy.trackSharedAttribute(ZoeValidFlagTracker$Proxy$_$$_WeldClientProxy.java) [zoeppritz_ejb_impl-1.0.0-SNAPSHOT.jar:]

             ...

       

      Here's the start of the stack trace up to the first call to the EJB:

       

      ...

      at de.itinformatik.zoeppritz.article.impl.mbean.ArticleImportMBean.importArticleMasterData(ArticleImportMBean.java:37) [zoeppritz_ejb_impl-1.0.0-SNAPSHOT.jar:]

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_30]

      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_30]

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_30]

      at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_30]

      at de.itinformatik.component.jmx.impl.util.MBeanImpl.invoke(MBeanImpl.java:225) [jmx-util-1.0.0-SNAPSHOT.jar:]

      at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836) [rt.jar:1.6.0_30]

      at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761) [rt.jar:1.6.0_30]

      at org.jboss.as.jmx.PluggableMBeanServerImpl$TcclMBeanServer.invoke(PluggableMBeanServerImpl.java:489)

      at org.jboss.as.jmx.PluggableMBeanServerImpl.invoke(PluggableMBeanServerImpl.java:243)

      at org.jboss.jmx.adaptor.control.Server.invokeOpByName(Server.java:219)

      at org.jboss.jmx.adaptor.control.Server.invokeOp(Server.java:194)

      at org.jboss.jmx.adaptor.html.HtmlAdaptorServlet$3.run(HtmlAdaptorServlet.java:327)

      at org.jboss.jmx.adaptor.html.HtmlAdaptorServlet$3.run(HtmlAdaptorServlet.java:325)

      at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.6.0_30]

      at org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.invokeOp(HtmlAdaptorServlet.java:325)

      at org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.invokeOp(HtmlAdaptorServlet.java:251)

      at org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.processRequest(HtmlAdaptorServlet.java:97)

      at org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.doPost(HtmlAdaptorServlet.java:80)

      at javax.servlet.http.HttpServlet.service(HttpServlet.java:754) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]

      at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]

      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)

      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)

      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)

      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)

      at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:154)

      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)

      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)

      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)

      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)

      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)

      at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_30]

       

      Please let me know when you need the entire stack trace (I won't include it in order to reduce clutter as much as possible).

       

       

       

      AFAIK the request context should be active during any EJB call and from what I saw in JIRA, this might be fixed upstream already (if this is really the same issue).

      However, we can't use the upstream version and thus have to stick with JBoss 7.1.1.Final at most for now.

       

      Any ideas of how to fix this or how to work around the issue until JBoss 7.2 is ready are welcome.