【发布时间】:2020-03-20 20:31:48
【问题描述】:
我想在我的 spring boot 应用程序中集成所有 kie-server 自动配置(尤其是 JBPM)。 我在项目的单独模块中添加了这些 gradle 依赖项
dependencies {
compile group: 'org.kie', name: 'kie-server-spring-boot-starter', version: '7.29.0.Final'
compile group: 'xerces', name: 'xercesImpl', version: '2.12.0'
}
然后我添加了此链接建议的配置属性
然后我尝试启动应用程序,但出现此错误:
***************************
APPLICATION FAILED TO START
***************************
Description:
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.
Action:
Consider defining a bean of type 'org.springframework.boot.jdbc.XADataSourceWrapper' in your configuration.
JBPMDataSourceAutoConfiguration 类链接如下
如何在我现有的 spring boot 项目中正确配置 jbpm/drools/kie 的嵌入式集成?
---------更新-------------
设置spring.jta.enabled = true属性后,异常在
***************************
APPLICATION FAILED TO START
***************************
Description:
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 @ConditionalOnProperty (narayana.dbcp.enabled=false) found different value in property 'narayana.dbcp.enabled'
- 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 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 @ConditionalOnClass did not find required class 'bitronix.tm.jndi.BitronixContext'
Action:
Consider revisiting the entries above or defining a bean of type 'org.springframework.boot.jdbc.XADataSourceWrapper' in your configuration.
【问题讨论】:
-
您使用的是什么数据库?如果数据库不支持 XA,则可能会触发该错误。您还可以发布您用于数据库连接的配置吗?
-
我正在使用 Postgres,这是 application.yml 中的配置
spring: datasource: url: jdbc:postgresql://localhost:5432/dbname username: user password: password driver-class-name: org.postgresql.xa.PGXADataSource -
您使用的是哪个事务管理器?因为您需要一个用于 XA 交易
-
spring.jta.narayana.transaction-manager-id=1 -
@HasanCanSaral 该问题是由在同一个项目中使用带有“@EnableBatchProcessing”注释的 SpringBatchConfig 类引起的。这些配置似乎与 kie-server 的配置相冲突。我已删除该注释并手动实现了 bean jobLauncher、jobRepository、jobExplorer 等。
标签: spring-boot jbpm kie-server