Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-2645

Problem to instanciate ProcessEngine in 4.2

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • jBPM 4.3
    • jBPM 4.2
    • Runtime Engine
    • None

      When I want to instanciate my project engine, I have an exception. It was working in 4.0 and 4.1 but not in 4.2.
      I think it is because a field must be setted in jbpm but I don't which.

      Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngine' defined in class path resource [ged/rtma/alice/workflow/core/process/applicationContext-core-process.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.jbpm.api.ProcessEngine org.jbpm.pvm.internal.cfg.SpringConfiguration.buildProcessEngine()] threw exception; nested exception is org.jbpm.pvm.internal.wire.WireException: couldn't initialize object 'org.jbpm.pvm.internal.jobexecutor.JobExecutor': couldn't invoke method start: couldn't invoke 'start' with null on org.jbpm.pvm.internal.jobexecutor.JobExecutor@14ba9a2: no command executor available in job executor
      at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:444)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:903)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:817)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
      at java.security.AccessController.doPrivileged(Native Method)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
      at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
      at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
      at ged.rtma.alice.workflow.core.component.DeploymentDemo.main(DeploymentDemo.java:40)
      Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.jbpm.api.ProcessEngine org.jbpm.pvm.internal.cfg.SpringConfiguration.buildProcessEngine()] threw exception; nested exception is org.jbpm.pvm.internal.wire.WireException: couldn't initialize object 'org.jbpm.pvm.internal.jobexecutor.JobExecutor': couldn't invoke method start: couldn't invoke 'start' with null on org.jbpm.pvm.internal.jobexecutor.JobExecutor@14ba9a2: no command executor available in job executor
      at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:127)
      at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:435)
      ... 17 more
      Caused by: org.jbpm.pvm.internal.wire.WireException: couldn't initialize object 'org.jbpm.pvm.internal.jobexecutor.JobExecutor': couldn't invoke method start: couldn't invoke 'start' with null on org.jbpm.pvm.internal.jobexecutor.JobExecutor@14ba9a2: no command executor available in job executor
      at org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor.initialize(ObjectDescriptor.java:238)
      at org.jbpm.pvm.internal.wire.WireContext.performInitialization(WireContext.java:533)
      at org.jbpm.pvm.internal.wire.WireContext.processPendingInitializations(WireContext.java:564)
      at org.jbpm.pvm.internal.wire.WireContext.create(WireContext.java:450)
      at org.jbpm.pvm.internal.wire.WireContext.create(WireContext.java:437)
      at org.jbpm.pvm.internal.wire.WireContext.get(WireContext.java:417)
      at org.jbpm.pvm.internal.wire.WireContext.initializeEagerObjects(WireContext.java:283)
      at org.jbpm.pvm.internal.wire.WireContext.create(WireContext.java:268)
      at org.jbpm.pvm.internal.cfg.ProcessEngineImpl.buildProcessEngine(ProcessEngineImpl.java:157)
      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)
      ... 18 more
      Caused by: org.jbpm.pvm.internal.wire.WireException: couldn't invoke method start: couldn't invoke 'start' with null on org.jbpm.pvm.internal.jobexecutor.JobExecutor@14ba9a2: no command executor available in job executor
      at org.jbpm.pvm.internal.wire.operation.InvokeOperation.apply(InvokeOperation.java:43)
      at org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor.initialize(ObjectDescriptor.java:234)
      ... 32 more
      Caused by: org.jbpm.api.JbpmException: couldn't invoke 'start' with null on org.jbpm.pvm.internal.jobexecutor.JobExecutor@14ba9a2: no command executor available in job executor
      at org.jbpm.pvm.internal.util.ReflectUtil.invoke(ReflectUtil.java:163)
      at org.jbpm.pvm.internal.wire.operation.InvokeOperation.apply(InvokeOperation.java:39)
      ... 33 more
      Caused by: org.jbpm.api.JbpmException: no command executor available in job executor
      at org.jbpm.pvm.internal.jobexecutor.JobExecutor.start(JobExecutor.java:78)
      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.jbpm.pvm.internal.util.ReflectUtil.invoke(ReflectUtil.java:160)
      ... 34 more

      My SpringContext

      <?xml version="1.0" encoding="UTF-8"?>
      <beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="
      http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">

      <bean id="jbpmConfiguration" class="org.jbpm.pvm.internal.cfg.SpringConfiguration">
      <constructor-arg value="/ged/rtma/alice/workflow/core/process/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" />
      <bean id="taskService" factory-bean="processEngine" factory-method="getTaskService" />
      <bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService" />
      <bean id="managementService" factory-bean="processEngine" factory-method="getManagementService" />

      </beans>

      My jbpm.cfg.xml

      <?xml version="1.0" encoding="UTF-8"?>

      <jbpm-configuration >

      <import resource="jbpm.jpdl.cfg.xml" />
      <import resource="jbpm.identity.cfg.xml" />
      <!-import resource="jbpm.jobexecutor.cfg.xml" /->

      <process-engine-context>
      <repository-service />
      <repository-cache />
      <execution-service >
      <command-service></command-service>
      </execution-service>
      <history-service />
      <management-service />
      <identity-service />
      <task-service />

      <!-- Here we needed to change the transaction interceptor -->
      <command-service>
      <retry-interceptor />
      <environment-interceptor />
      <spring-transaction-interceptor />

      </command-service>

      <!-- Added spring as read-context -->
      <script-manager default-expression-language="juel"
      default-script-language="juel"
      read-contexts="execution, environment, process-engine, spring"
      write-context="">
      <script-language name="juel"
      factory="org.jbpm.pvm.internal.script.JuelScriptEngineFactory" />
      </script-manager>

      <!-authentication /->

      <id-generator />
      <types resource="jbpm.variable.types.xml" />

      <address-resolver />

      <job-executor threads="10" idle="5000" idle-max="10000"/>

      </process-engine-context>

      <transaction-context>
      <repository-session />
      <db-session />

      <message-session />
      <timer-session />
      <history-session />
      <mail-session>
      <mail-server>
      <session-properties resource="jbpm.mail.properties" />
      </mail-server>
      </mail-session>

      <!-- Need to set explicitly that we don't want jbpm to create sessions -->
      <hibernate-session current="true" />
      </transaction-context>
      </jbpm-configuration>

              jbarrez Joram Barrez (Inactive)
              alexandre.navarro Alexandre Navarro (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: