6 Replies Latest reply on Jul 11, 2009 10:23 AM by aguizar

    EJB Timer Lookup problem in BPEL

    dhanushgopinath

      Hi,

      I am using jbpm bpel 1.1.1 with Jboss 4.2.0 and I am extensively using the BPEL process using JBPM/BPEL API's.

      I am getting this exception while the process ends

      18:39:11,128 ERROR [SOAPFaultHelperJAXWS] SOAP request exception
      org.jbpm.JbpmException: ejb timer entity lookup problem
       at org.jbpm.scheduler.ejbtimer.EntitySchedulerServiceFactory.getTimerEntityHome(EntitySchedulerServiceFactory.java:43)
       at org.jbpm.scheduler.ejbtimer.EntitySchedulerServiceFactory.openService(EntitySchedulerServiceFactory.java:50)
       at org.jbpm.svc.Services.getService(Services.java:150)
       at org.jbpm.svc.Services.getCurrentService(Services.java:94)
       at org.jbpm.graph.exe.ProcessInstance.end(ProcessInstance.java:328)
       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.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:173)
       at org.jbpm.graph.exe.ProcessInstance_$$_javassist_351.end(ProcessInstance_$$_javassist_351.java)
       at org.jbpm.graph.exe.Token.notifyParentOfTokenEnd(Token.java:329)
       at org.jbpm.graph.exe.Token.end(Token.java:301)


      As per the code in CVS the EntitySchedulerServiceFactory class in jbpm bpel is looking up for a JNDI name java:comp/env/ejb/LocalTimerEntityBean and expecting org.jbpm.ejb.LocalTimerEntityHome.

      But while deploying the JBPM BPEL it binds the jndi name ejb/LocalTimerEntityBean against the Local Home org.jbpm.ejb.LocalTimerEntityHome. I got this information from the ejb-jar.xml file in jbpm-enterprise.jar (inside jbpm-bpel.ear).

      So when the EntitySchedulerServiceFactory code tries to lookup, it doesnt get it and throws the above exception.

      This exception ONLY happens when I start the process in API mode. If I use SOAP-UI to test, it works perfectly fine.

      Do I need to configure anything extra? Please let me know. I am kind of stuck here.

      Thanks in Advance
      Dhanush

        • 1. Re: EJB Timer Lookup problem in BPEL
          dhanushgopinath

          Hi,

          I got one more additional information here:

          When I run the BPEL WS from SOAP-UI, the object of EntitySchedulerServiceFactory is having its timerEntityHomeJndiName as "java:comp/env/ejb/LocalTimerEntityBean" and the timerEntityHome object is populated.

          When I run the BPEL WS through API, the object of EntitySchedulerServiceFactory is having its timerEntityHomeJndiName as "java:comp/env/ejb/LocalTimerEntityBean" and the timerEntityHome object is NULL.

          Thanks
          Dhanush

          • 2. Re: EJB Timer Lookup problem in BPEL
            dhanushgopinath

            Ok. I did some more research, added in web.xml of my application this snippet

            <ejb-local-ref>
             <ejb-ref-name>ejb/LocalTimerEntityBean</ejb-ref-name>
             <ejb-ref-type>Entity</ejb-ref-type>
             <local-home>org.jbpm.ejb.LocalTimerEntityHome</local-home>
             <local>org.jbpm.ejb.LocalTimerEntity</local>
             <ejb-link>TimerEntityBean</ejb-link>
             </ejb-local-ref>


            and then added in the jboss-web.xml
            <ejb-local-ref>
             <ejb-ref-name>ejb/LocalTimerEntityBean</ejb-ref-name>
             <local-jndi-name>java:ejb/TimerEntityBean</local-jndi-name>
             </ejb-local-ref>


            Then I ran my application and when the process ends ejb timer lookup problem is now gone. But its throwing a class cast exception.

            Caused by: java.lang.ClassCastException: $Proxy63
             at org.jbpm.scheduler.ejbtimer.EntitySchedulerServiceFactory.getTimerEntityHome(EntitySchedulerServiceFactory.java:41)
             at org.jbpm.scheduler.ejbtimer.EntitySchedulerServiceFactory.openService(EntitySchedulerServiceFactory.java:50)
             at org.jbpm.svc.Services.getService(Services.java:150)
             at org.jbpm.svc.Services.getCurrentService(Services.java:94)
             at org.jbpm.graph.exe.ProcessInstance.end(ProcessInstance.java:328)
             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)


            The same $Proxy63 class is getting created after looking up in the case of Process Ending while running the process with a SOAP-UI. But no exception is thrown in that case.

            Please let me know if you have any info on this.

            Thanks
            Dhanush

            • 3. Re: EJB Timer Lookup problem in BPEL

              Were you able to resolve this error? Does anyone knows a solution to this problem?

              • 4. Re: EJB Timer Lookup problem in BPEL
                zoegraddy

                I am also seeing the "org.jbpm.JbpmException: ejb timer entity lookup" exception but it appears to be some sort of bootstrap issue. My process definition has a decision node where one possible path goes to a task-node with a task that has a timer. The other path does not have any timers. This exception is thrown each time a process instance reaches the timer and the timer does not fire when the due date is reached. This results in process instances sitting at the timer indefinitely.

                The only workaround I have found is to immediate walk a process instance through the non-timer path of the process definition after jboss starts up (we have jbpm deployed inside jboss). Then, when any subsequent processes take the timer path, no exception is thrown and everything works perfectly. This is of course not an ideal solution as we have to remember to do this hack each time our server starts up.

                Any help is much appreciated!

                Zoe

                • 5. Re: EJB Timer Lookup problem in BPEL
                  dhanushgopinath

                  No Guys.

                  I am still having the Class Cast Exception. Any help is appreciated.

                  The problem is that my process instance is never shown as ended because of this exception.

                  thanks
                  Dhanush

                  • 6. Re: EJB Timer Lookup problem in BPEL
                    aguizar

                    the problem posted by zoe occurs on what seems to be a jpdl process, so let me focus on dhanush's problem first.

                    dhanush, when you say "api mode" are you invoking methods outside the enterprise app (i.e. code not deployed inside jbpm-bpel.ear)? if you are, then your app's ENC will not contain the appropriate references to jbpm-bpel's enterprise beans. this accounts for the apparent absence.

                    even if you 'fix' the references, your app and jbpm-bpel.ear will have different class loaders and result in the class class exception. hence you should either move your app inside jbpm-bpel.ear or take out the shared jars and put them in the server configuration's lib folder (e.g. jboss/server/default/lib).

                    tell me how it goes.