7 Replies Latest reply on Mar 31, 2009 12:29 PM by boxwala

    jms notbound exception when accessing jbpm context from ejb

    fransja

      Hi,

      I have an ejb which needs access to a jbpm process.
      I am using the following code to obtain access:

      JbpmContext jbpmContext = null;
       try {
       log.debug("Trying to get JBPM context...");
       JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
       jbpmContext = jbpmConfiguration.createJbpmContext();
       log.debug("JbpmContext initialized successfully");
      
       //do stuff...
      
       }
       catch (Exception e) {
       log.warn("JbpmContext failed to initialize...",e);
       return;
       }
       finally {
       if (jbpmContext != null) {
       jbpmContext.close();
       }
       }


      I am using jbpm 3.2.3, Jboss 4.2.2 and seam 2.0.2

      When the server starts and I access the ejb I get an exception (see below) which is caused by a "jms not bound" Exception

      When I start the jbpm-console, and login and then access the ejb
      the above code works.....

      When the "jms not bound" is thrown the jbpm-console also not works.

      Stacktrace:

      org.jbpm.JbpmException: couldn't instantiate bean 'null' of type 'org.jbpm.msg.jms.JmsMessageServiceFactoryImpl'
      at org.jbpm.configuration.BeanInfo.createObject(BeanInfo.java:88)
      at org.jbpm.configuration.JbpmContextInfo.createObject(JbpmContextInfo.java:129)
      at org.jbpm.configuration.ObjectFactoryImpl.getObject(ObjectFactoryImpl.java:146)
      at org.jbpm.configuration.ObjectFactoryImpl.createObject(ObjectFactoryImpl.java:103)
      at org.jbpm.configuration.ObjectFactoryImpl.createObject(ObjectFactoryImpl.java:78)
      at org.jbpm.JbpmConfiguration.createJbpmContext(JbpmConfiguration.java:394)
      at org.jbpm.JbpmConfiguration.createJbpmContext(JbpmConfiguration.java:390)
      at com.twoorganize.chips.services.jobs.impl.OracleJobMonitorServiceBean.monitorJobs(OracleJobMonitorServiceBean.java:125)
      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.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
      at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
      at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
      at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
      at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.service.ServiceContainer.localInvoke(ServiceContainer.java:329)
      at org.jboss.ejb3.service.ServiceContainer.localInvoke(ServiceContainer.java:294)
      at org.jboss.ejb3.service.ServiceMBeanDelegate.invoke(ServiceMBeanDelegate.java:215)
      at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.jmx.adaptor.control.Server.invokeOpByName(Server.java:258)
      at org.jboss.jmx.adaptor.control.Server.invokeOp(Server.java:223)
      at org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.invokeOp(HtmlAdaptorServlet.java:262)
      at org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.processRequest(HtmlAdaptorServlet.java:100)
      at org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.doPost(HtmlAdaptorServlet.java:82)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
      at java.lang.Thread.run(Thread.java:595)
      Caused by: org.jbpm.JbpmException: jms object lookup problem
      at org.jbpm.msg.jms.JmsMessageServiceFactoryImpl.(JmsMessageServiceFactoryImpl.java:80)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
      at java.lang.Class.newInstance0(Class.java:350)
      at java.lang.Class.newInstance(Class.java:303)
      at org.jbpm.configuration.BeanInfo.createObject(BeanInfo.java:86)
      ... 61 more
      Caused by: javax.naming.NameNotFoundException: jms not bound
      at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
      at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
      at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
      at org.jnp.server.NamingServer.lookup(NamingServer.java:267)
      at org.jnp.server.NamingServer.lookup(NamingServer.java:270)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:667)
      at org.jboss.ejb3.naming.MultiplexerContext.lookup(MultiplexerContext.java:233)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:774)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
      at javax.naming.InitialContext.lookup(InitialContext.java:351)
      at org.jbpm.msg.jms.JmsMessageServiceFactoryImpl.(JmsMessageServiceFactoryImpl.java:74)
      ... 68 more


      any idea's?

      Thanks

      Frans




        • 1. Re: jms notbound exception when accessing jbpm context from
          kukeltje

          have you created the jms queues?

          • 2. Re: jms notbound exception when accessing jbpm context from
            fransja

            Hi,

            I have tried this, but no luck so far. But when I make no extra configuration and just use the jbpm-enterprise.ear.

            The strange thing is that when I login to the jbpm-console first it works, can't find what it is doing then

            In the jmx-console (same before en after logging in to the jbpm-console) I see:
            +- UserTransaction[link -> UserTransaction] (class: javax.naming.LinkRef)
            +- env (class: org.jnp.interfaces.NamingContext)
            | +- jdbc (class: org.jnp.interfaces.NamingContext)
            | | +- JbpmDataSource[link -> java:ChipsDS] (class: javax.naming.LinkRef)
            | +- ejb (class: org.jnp.interfaces.NamingContext)
            | | +- LocalTimerEntityBean[link -> java:ejb/TimerEntityBean] (class: javax.naming.LinkRef)
            | +- security (class: org.jnp.interfaces.NamingContext)
            | | +- realmMapping[link -> java:/jaas/jbpm] (class: javax.naming.LinkRef)
            | | +- subject[link -> java:/jaas/jbpm/subject] (class: javax.naming.LinkRef)
            | | +- securityMgr[link -> java:/jaas/jbpm] (class: javax.naming.LinkRef)
            | | +- security-domain[link -> java:/jaas/jbpm] (class: javax.naming.LinkRef)
            | +- jms (class: org.jnp.interfaces.NamingContext)
            | | +- JbpmConnectionFactory[link -> java:JmsXA] (class: javax.naming.LinkRef)
            | | +- JobQueue[link -> queue/JbpmJobQueue] (class: javax.naming.LinkRef)

            So I assume this is done by the jbpm-enterprise application.

            Else any suggestion what and where configure?

            Thanks,

            Frans

            • 3. Re: jms notbound exception when accessing jbpm context from
              fransja

              To be more precise, the exception occurs in the JmsMessageServiceFactoryImpl on line 74:

              public JmsMessageServiceFactoryImpl() {
               try {
               Context initial = new InitialContext();
               //next line fails when creating jbpmContext from ejb before you login to the jbpm-console
               connectionFactory = (ConnectionFactory) initial.lookup(connectionFactoryJndiName);
               destination = (Destination) initial.lookup(destinationJndiName);
               initial.close();
               }
               catch (NamingException e) {
               log.error("jms object lookup problem", e);
               throw new JbpmException("jms object lookup problem", e);
               }
               }


              • 4. Re: jms notbound exception when accessing jbpm context from
                ciloriveros

                have you found the solution? I have the same problem

                • 5. Re: jms notbound exception when accessing jbpm context from
                  ciloriveros

                  I'm using jboss 4.2.3 and jbpm 3.2.3, jdk 6.0.
                  And only works when I login to the jbpm-console first

                  • 6. Re: jms notbound exception when accessing jbpm context from
                    boxwala

                    I have the same problem.

                    • 7. Re: jms notbound exception when accessing jbpm context from
                      boxwala

                      My problem was caused by incorrectly using the JBPM EJBs. I was making calls to the embedded classes rather than the EJB classes. Once my application invoked the EJBs, the timer issue went away.