Issue
Im new to JBPM Im trying to configure Junit with spring and JBPM. The Problem Im facing is while running the test case when it loads application context xml. I get the below exception.
java.lang.IllegalStateException: Failed to load ApplicationContext
...
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'runtimeEnvironment': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalArgumentException: Cannot add asset: Process Compilation error Type mismatch: cannot convert from boolean to Object
Type mismatch: cannot convert from boolean to Object,
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:175)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:127)
at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1600)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:254)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351)
... 44 more
Caused by: java.lang.IllegalArgumentException: Cannot add asset: Process Compilation error Type mismatch: cannot convert from boolean to Object
Type mismatch: cannot convert from boolean to Object,
at org.jbpm.runtime.manager.impl.SimpleRuntimeEnvironment.addAsset(SimpleRuntimeEnvironment.java:171)
at org.jbpm.runtime.manager.impl.RuntimeEnvironmentBuilder.addAsset(RuntimeEnvironmentBuilder.java:341)
at org.jbpm.runtime.manager.impl.RuntimeEnvironmentBuilder.addAsset(RuntimeEnvironmentBuilder.java:74)
at com.citi.common.workflow.factory.RuntimeEnvironmentFactoryBean.getObject(RuntimeEnvironmentFactoryBean.java:135)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:168)
... 49 more
find below the configuration it fails adding the assest
<bean id="xxx" factory-method="newClassPathResource"
class="org.kie.internal.io.ResourceFactory">
<constructor-arg>
<value>config/local/jbpm/processes/yyy.bpmn2</value>
</constructor-arg>
</bean>
<bean id="runtimeEnvironment"
class="com.citi.common.workflow.factory.RuntimeEnvironmentFactoryBean">
<property name="type" value="DEFAULT" />
<property name="assets">
<map>
<entry key-ref="xxx">
<util:constant static-field="org.kie.api.io.ResourceType.BPMN2" />
</entry>
</map>
</property>
<property name="userInfo" ref="jbpmUserInfo" />
<property name="taskService" ref="taskService" />
<property name="entityManagerFactory" ref="xxxEntityManagerFactoryBean" />
<property name="transactionManager" ref="xxxTransactionManager"/>
</bean>
I am using JBPM-6.5.0 I also tried compiling the class files to JAVA 1.7 but still getting same error any help will be appreciated.
Solution
Including the below dependency in my pom resolved the issue.
<dependency>
<groupId>org.jbpm</groupId>
<artifactId>jbpm-test</artifactId>
<version>${jbpm.version}</version>
<scope>test</scope>
</dependency>
Answered By - Lakshmi