我用 spring 在 jbpm 上做项目。但是当我运行时,我得到这个错误:
Parameter 0 of constructor in org.jbpm.springboot.datasources.JBPMDataSourceAutoConfiguration required a bean of type 'org.springframework.boot.jdbc.XADataSourceWrapper' that could not be found.
The following candidates were found but could not be injected:
- Bean method 'xaDataSourceWrapper' in 'NarayanaConfiguration.GenericJdbcConfiguration' not loaded because Ancestor me.snowdrop.boot.narayana.autoconfigure.NarayanaConfiguration did not match
- Bean method 'xaDataSourceWrapper' in 'NarayanaConfiguration.PooledJdbcConfiguration' not loaded because @ConditionalOnProperty (narayana.dbcp.enabled=true) did not find property 'narayana.dbcp.enabled'
- Bean method 'xaDataSourceWrapper' in 'NarayanaConfiguration.PooledJdbcConfiguration' not loaded because Ancestor me.snowdrop.boot.narayana.autoconfigure.NarayanaConfiguration did not match
- Bean method 'xaDataSourceWrapper' in 'AtomikosJtaConfiguration' not loaded because @ConditionalOnClass did not find required class 'com.atomikos.icatch.jta.UserTransactionManager'
- Bean method 'xaDataSourceWrapper' in 'BitronixJtaConfiguration' not loaded because @ConditionalOnMissingBean (types: org.springframework.transaction.PlatformTransactionManager; SearchStrategy: all) found beans of type 'org.springframework.transaction.PlatformTransactionManager' jbpmTxManager
Action:
Consider revisiting the entries above or defining a bean of type 'org.springframework.boot.jdbc.XADataSourceWrapper' in your configuration.
豆类:
<bean id="btmConfig" factory-method="getConfiguration" class="bitronix.tm.TransactionManagerServices"/>
<bean id="bitronixTransactionManager" factory-method="getTransactionManager"
class="bitronix.tm.TransactionManagerServices" depends-on="btmConfig" destroy-method="shutdown" />
<bean id="jbpmTxManager" class="org.springframework.transaction.jta.JtaTransactionManager">
<property name="transactionManager" ref="bitronixTransactionManager" />
<property name="userTransaction" ref="bitronixTransactionManager" />
</bean>
<bean id="process" factory-method="newClassPathResource" class="org.kie.internal.io.ResourceFactory">
<constructor-arg>
<value>jbpm/processes/sample.bpmn</value>
</constructor-arg>
</bean>
<bean id="runtimeManager" class="org.kie.spring.factorybeans.RuntimeManagerFactoryBean" destroy-method="close">
<property name="identifier" value="spring-rm"/>
<property name="runtimeEnvironment" ref="runtimeEnvironment"/>
</bean>
<bean id="runtimeEnvironment" class="org.kie.spring.factorybeans.RuntimeEnvironmentFactoryBean">
<property name="environmentEntries" ref="env" />
</bean>
<util:map id="env" key-type="java.lang.String" value-type="java.lang.Object">
<entry>
<key>
<util:constant
static-field="org.kie.api.runtime.EnvironmentName.USE_LOCAL_TRANSACTIONS" />
</key>
<value>true</value>
</entry>
</util:map>
<bean id="transactionCmdService" class="org.jbpm.shared.services.impl.TransactionalCommandService">
<constructor-arg name="emf" ref="entityManagerFactory"/>
</bean>
<bean id="taskService" class="org.kie.spring.factorybeans.TaskServiceFactoryBean" destroy-method="close">
<property name="entityManagerFactory" ref="entityManagerFactory"/>
<property name="transactionManager" ref="transactionManager"/>
<property name="userGroupCallback" ref="userGroupCallback"/>
<property name="listeners">
<list>
<bean class="org.jbpm.services.task.audit.JPATaskLifeCycleEventListener">
<constructor-arg value="true"/>
</bean>
</list>
</property>
</bean>
<!-- Definition service -->
<bean id="definitionService" class="org.jbpm.kie.services.impl.bpmn2.BPMN2DataServiceImpl"/>
<!-- Runtime data service -->
<bean id="runtimeDataService" class="org.jbpm.kie.services.impl.RuntimeDataServiceImpl">
<property name="commandService" ref="transactionCmdService"/>
<property name="identityProvider" ref="identityProvider"/>
<property name="taskService" ref="taskService"/>
</bean>
<!-- Deployment service -->
<bean id="deploymentService" class="org.jbpm.kie.services.impl.KModuleDeploymentService" depends-on="entityManagerFactory" init-method="onInit">
<property name="bpmn2Service" ref="definitionService"/>
<property name="emf" ref="entityManagerFactory"/>
<property name="managerFactory" ref="runtimeManagerFactory"/>
<property name="identityProvider" ref="identityProvider"/>
<property name="runtimeDataService" ref="runtimeDataService"/>
</bean>
<!-- Process service -->
<bean id="processService" class="org.jbpm.kie.services.impl.ProcessServiceImpl" depends-on="deploymentService">
<property name="dataService" ref="runtimeDataService"/>
<property name="deploymentService" ref="deploymentService"/>
</bean>
<!-- User task service -->
<bean id="userTaskService" class="org.jbpm.kie.services.impl.UserTaskServiceImpl" depends-on="deploymentService">
<property name="dataService" ref="runtimeDataService"/>
<property name="deploymentService" ref="deploymentService"/>
</bean>
<!--RuntimeEnvironmentFactoryBean Register the runtime data service as a listener on the deployment service so it can receive notification about deployed and undeployed units -->
<bean id="data" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean" depends-on="deploymentService">
<property name="targetObject" ref="deploymentService"/>
<property name="targetMethod" value="addListener"/>
<property name="arguments">
<list>
<ref bean="runtimeDataService"/>
</list>
</property>
</bean>
如何解决这个错误?