Default datasource for configuration with schema-name - PersistenceException

I’m encountering an issue with my Camunda Spring Boot application. I’ve configured Camunda to use a separate schema named “camundadb” for its tables in the PostgreSQL database. However, when I run the application, I receive the following error:

shellCopy code

Caused by: org.apache.ibatis.exceptions.PersistenceException: 
### Error querying database. Cause: org.postgresql.util.PSQLException: ERROR: relation "camunda2.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 camunda2.ACT_GE_PROPERTY where NAME_ = 'schema.version'
### Cause: org.postgresql.util.PSQLException: ERROR: relation "camunda2.act_ge_property" does not exist
Position : 20

Configuration:

spring:
  datasource:
    driver-class-name: org.postgresql.Driver
    driverClassName: org.postgresql.Driver
    url: jdbc:postgresql://localhost:5432/mydb
    username: postgres
    password: root
camunda:
  bpm:
    admin-user:
      id: demo
      password: demo
    deployment-resource-pattern:
      - classpath*:camunda-process/*.bpmn
    database:
      type: postgres
      schema-update: false
      schema-name: camundadb
      table-prefix: camundadb.
  webapp:
    webjar-url-pattern: /camunda/app/*

Issue: When running my Camunda Spring Boot application, it fails to find the table “camunda2.act_ge_property” despite being configured to use the schema “camundadb”. The error suggests that Camunda is attempting to query tables in the incorrect schema.

Objective: I need assistance in resolving this issue to ensure that Camunda correctly generates its tables in the specified schema “camundadb”.

Hi @Hicham_FAOUZI
Just to understand the initial state. When you want to use a different schema, you must create the database tables yourself because it can only create the tables on the default schema. Did you do it?

Regards,
Alex

Hello Alex,

Thank you for your inquiry !

Indeed, if you let Camunda generate its tables in the default database “mydb”, it will do so automatically. However, if you specify another schema, you will need to generate the tables using a script.