3 Replies Latest reply on Oct 30, 2009 9:11 AM by Joel Mathew

    NullPointerException in JobExecutorMessageSession.send while

    Joel Mathew Newbie

      I have an application which is using spring and jbpm 4.0.
      The application works fine if all the tasks are synchronous .
      But when I add an asynchronous task in between it is giving me
      Null pointerException in JobExecutorMessageSession.send.
      It seems like the transaction is not injected into the JobExecutorMessageSession. I have JobExecuter configured in my

      <import resource="jbpm.jobexecutor.cfg.xml" />

      and my spring config contain
      <bean id="jbpmConfiguration" class="org.jbpm.pvm.internal.cfg.SpringConfiguration">
       <constructor-arg value="etc/jbpm.cfg.xml" />
       <bean id="processEngine" factory-bean="jbpmConfiguration" factory-method="buildProcessEngine" lazy-init="false" />

      I tried jbpm 4.0 but it it is also giving the same exception.
      Can anybody suggest what i am doing wrong...

        • 1. Re: NullPointerException in JobExecutorMessageSession.send w
          Joram Barrez Master

          Could you post the exact stacktrace. I've seen the job executor working on Spring earlier.

          • 2. Re: NullPointerException in JobExecutorMessageSession.send w
            Joel Mathew Newbie


            <?xml version="1.0" encoding="UTF-8"?>
             <import resource="jbpm.jpdl.cfg.xml" />
             <import resource="jbpm.identity.cfg.xml" />
             <import resource="jbpm.jobexecutor.cfg.xml" />
             <job-executor threads="10" idle="15000" idle-max="60000" lock-millis="3600000" />
             <repository-service />
             <repository-cache />
             <execution-service />
             <history-service />
             <management-service />
             <identity-service />
             <task-service />
             <!-- Here we needed to change the transaction interceptor -->
             <retry-interceptor />
             <environment-interceptor />
             <spring-transaction-interceptor />
             <!-- Added spring as read-context -->
             <script-manager default-expression-language="juel"
             read-contexts="execution, environment, process-engine, spring"
             <script-language name="juel"
             factory="org.jbpm.pvm.internal.script.JuelScriptEngineFactory" />
             <!-- <authentication /> -->
             <id-generator />
             <types resource="jbpm.variable.types.xml" />
             <address-resolver />
             <monday hours="9:00-12:00 and 12:30-17:00" />
             <tuesday hours="9:00-12:00 and 12:30-17:00" />
             <wednesday hours="9:00-12:00 and 12:30-17:00" />
             <thursday hours="9:00-12:00 and 12:30-17:00" />
             <friday hours="9:00-12:00 and 12:30-17:00" />
             <holiday period="01/07/2008 - 31/08/2008" />
             <mail-template name='task-notification'>
             <to users="${task.assignee}" />
             <text><![CDATA[Hi ${task.assignee},
            Task "${task.name}" has been assigned to you.
            Sent by JBoss jBPM
             <mail-template name='task-reminder'>
             <to users="${task.assignee}" />
             <text><![CDATA[Hey ${task.assignee},
            Do not forget about task "${task.name}".
            Sent by JBoss jBPM
             <repository-session />
             <db-session />
             <transaction />
             <message-session />
             <timer-session />
             <history-session />
             <session-properties resource="jbpm.mail.properties" />
             <!-- Need to set explicitly that we don't want jbpm to create sessions -->
             <hibernate-session current="false" />

            The above configuration worked. I was missing tag in <transaction-context> and I have upgraded to jbpm 4.1