Details
-
Bug
-
Resolution: Done
-
Major
-
7.7.1.GA
-
None
-
Release Notes
-
CR1
-
?
-
2020 Week 31-33 (from Jul 27)
Description
colored textUsing kie-server with springboot, if you define a secondary datasource JBPMAutoConfiguration fails to instanciate entityManagerFactory.
We expected JBPM datasource to be marked as @Primary to avoid this.
A reproducer is provided. It only needs a postgres database test
jdbc:postgresql://localhost:5432/test
```
unzip reproducer.zip
cd example
cd business-central-service
./launch.sh clean install
```
The problems that arise are:
``` Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Schema "STUB_SCHEMA" no encontrado Schema "STUB_SCHEMA" not found; SQL statement: create table STUB_SCHEMA.FOO (FOO_ID int8 not null, FOO_VALUE varchar(255), primary key (FOO_ID)) [90079-200] at org.h2.message.DbException.getJdbcSQLException(DbException.java:576) ~[h2-1.4.200.jar!/:na] at org.h2.message.DbException.getJdbcSQLException(DbException.java:429) ~[h2-1.4.200.jar!/:na] ```
``` Description: Parameter 0 of method openEntityManagerInViewInterceptorConfigurer in org.springframework.boot.autoconfigure.orm.jpa.JpaBaseConfiguration$JpaWebConfiguration required a single bean, but 2 were found:
- applicationEntityManagerFactory: defined by method 'entityManagerFactory' in class path resource [com/company/service/config/ApplicationConfig.class]
- entityManagerFactory: defined by method 'entityManagerFactory' in class path resource [org/jbpm/springboot/autoconfigure/JBPMAutoConfiguration.class]
Action: Consider marking one of the beans as @Primary, updating the consumer to accept multiple beans, or using @Qualifier to identify the bean that should be consumed ```