1 Reply Latest reply on Nov 15, 2009 1:52 PM by Santanu Saraswati

    jbpm 4.2 spring 2.5.6 integration

    Alexandru MG Newbie

      Hello,

      I've been looking around for a good open source bpm solution and I end up choosing jBPM. Now, I'm trying to integrate it with Spring, but I'm facing some troubles.

      Here is the jbpm minimal configuration that I'm trying to use:

       <process-engine-context>
       <command-service>
       <retry-interceptor />
       <environment-interceptor />
       <spring-transaction-interceptor />
       </command-service>
       </process-engine-context>
      
       <transaction-context>
       <transaction />
       <hibernate-session current="true" />
       </transaction-context>
      


      , the spring configuration:

       <bean id="jbpmConfiguration" class="org.jbpm.pvm.internal.cfg.SpringConfiguration">
       <constructor-arg value="com/psinova/jbpm.cfg.xml" />
       </bean>
      
       <bean id="processEngine" factory-bean="jbpmConfiguration" factory-method="buildProcessEngine" />
       <bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" />
       <bean id="executionService" factory-bean="processEngine" factory-method="getExecutionService" />
      


      and when spring is trying to initialize the first bean, a npe is thrown with this stack:

      Caused by: java.lang.NullPointerException
       at org.jbpm.pvm.internal.cfg.ProcessEngineImpl.checkDb(ProcessEngineImpl.java:177)
       at org.jbpm.pvm.internal.cfg.ProcessEngineImpl.buildProcessEngine(ProcessEngineImpl.java:170)
       at org.jbpm.pvm.internal.cfg.SpringConfiguration.buildProcessEngine(SpringConfiguration.java:81)
       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:597)
       at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:115)
      


      I've also created a JIRA ticket for this issue: https://jira.jboss.org/jira/browse/JBPM-2646
      Am I doing something wrong? Please advise!

      Kind regards,
      Alexandru.

        • 1. Re: jbpm 4.2 spring 2.5.6 integration
          Santanu Saraswati Novice

          This is sample jpdl.cfg.xml. Please observe the command-service and db id generator mappings.

          <jbpm-configuration>
          
           <import resource="jbpm.businesscalendar.cfg.xml" />
           <import resource="jbpm.jpdl.cfg.xml" />
          
           <process-engine-context>
           <repository-service />
           <repository-cache />
           <execution-service />
           <history-service />
           <management-service />
           <task-service />
           <identity-service />
           <command-service name="txRequiredCommandService">
           <retry-interceptor />
           <environment-interceptor />
           <spring-transaction-interceptor/>
           </command-service>
          
           <object class="org.jbpm.pvm.internal.id.DatabaseDbidGenerator">
           <field name="commandService"><ref object="txRequiredCommandService" /></field>
           </object>
          
           <object class="org.jbpm.pvm.internal.id.DatabaseIdComposer" init="eager" />
          
           <script-manager default-expression-language="juel" default-script-language="juel">
           <script-language name="juel" factory="org.jbpm.pvm.internal.script.JuelScriptEngineFactory" />
           </script-manager>
          
           <job-executor auto-start="false" />
          
           <types resource="jbpm.variable.types.xml" />
           </process-engine-context>
          
           <transaction-context>
           <repository-session/>
           <db-session/>
          
           <message-session/>
           <timer-session/>
           <history-session/>
          
           <hibernate-session current="true"/>
           </transaction-context>
          
          </jbpm-configuration>
          


          You can also refer to this post http://www.jboss.org/index.html?module=bb&op=viewtopic&t=163512