I am trying to use two different datasources inside my embedded camunda spring boot project and also I found that the bean creation is successful for both the datasources(one for camunda and another for the application data). But inside the schema of the camunda specific datasource, application could not create any table, even when the application is running. From the server logs I can see the error below -
org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: org.postgresql.util.PSQLException: ERROR: relation "act_ge_property" does not exist
Position: 20
### The error may exist in org/camunda/bpm/engine/impl/mapping/entity/Property.xml
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: select VALUE_ from ACT_GE_PROPERTY where NAME_ = 'schema.version'
### Cause: org.postgresql.util.PSQLException: ERROR: relation "act_ge_property" does not exist
Position: 20
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:153)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:145)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:76)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:70)
at org.camunda.bpm.engine.impl.db.sql.DbSqlSession.getDbVersion(DbSqlSession.java:381)
at org.camunda.bpm.engine.impl.db.AbstractPersistenceSession.dbSchemaCreate(AbstractPersistenceSession.java:87)
at org.camunda.bpm.engine.impl.SchemaOperationsProcessEngineBuild.execute(SchemaOperationsProcessEngineBuild.java:52)
at org.camunda.bpm.engine.impl.SchemaOperationsProcessEngineBuild.execute(SchemaOperationsProcessEngineBuild.java:34)
at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:28)
at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:110)
at org.camunda.bpm.engine.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:46)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
at org.camunda.bpm.engine.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:44)
at org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor.execute(ProcessApplicationContextInterceptor.java:70)
at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
at org.camunda.bpm.engine.impl.ProcessEngineImpl.executeSchemaOperations(ProcessEngineImpl.java:120)
at org.camunda.bpm.engine.impl.ProcessEngineImpl.<init>(ProcessEngineImpl.java:93)
at org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProcessEngine(ProcessEngineConfigurationImpl.java:815)
at org.camunda.bpm.engine.spring.SpringTransactionsProcessEngineConfiguration.buildProcessEngine(SpringTransactionsProcessEngineConfiguration.java:63)
How can I avoid this error and let camunda create the required tables inside the given blank schema? Please find the camunda specific properties in application.yml file below -
spring:
application:
name: demoApp1
datasource:
primary:
username: ${DB_PG_USERNAME}
url: ${DB_PG_URL}
jdbcUrl: ${spring.datasource.primary.url}
password: ${DB_PASSWORD}
hikari:
pool-name: nanoApp
minimum-idle: 30
maximum-pool-size: 70
connection-timeout: 30000
idle-timeout: 15000
max-lifetime: 120000
validation-timeout: 10000
leak-detection-threshold: 120000
camunda:
username: ${DB_PG_USERNAME}
url: ${DB_PG_URL_TEST}
jdbcUrl: ${spring.datasource.camunda.url}
password: ${DB_PASSWORD}
hikari:
pool-name: nanoCamunda
minimum-idle: 30
maximum-pool-size: 70
connection-timeout: 30000
idle-timeout: 15000
max-lifetime: 120000
validation-timeout: 10000
leak-detection-threshold: 120000
camunda.bpm.database.schema-update: drop-create
I tried with create, true and other values also for the property “camunda.bpm.database.schema-update” but it did not work anyhow.
Can anyone help me out