在 RuntimeEnvironment 中包含 BPMN 文件的问题

Issue with including BPMN file in RuntimeEnvironment

我是 JBPM 的新手,我正在尝试使用 spring 和 JBPM 配置 Junit。我面临的问题是 运行 加载应用程序上下文时的测试用例 xml。我得到以下异常。

    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

在配置下方找到添加资产失败

<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>

我正在使用 JBPM-6.5.0 我也尝试将 class 文件编译为 JAVA 1.7 但仍然出现相同的错误任何帮助将不胜感激。

在我的 pom 中包含以下依赖项解决了这个问题。

        <dependency>
            <groupId>org.jbpm</groupId>
            <artifactId>jbpm-test</artifactId>
            <version>${jbpm.version}</version>
            <scope>test</scope>
        </dependency>