Manual Installation - DB2 Database -> Missing Tables

Hi,

i will setup camunda manualy with this manual: https://docs.camunda.org/manual/7.5/installation/full/tomcat/manual/

With H2 Database, everything works, but we use DB2 Databases here.

I executed the DB2-DDLs located here: https://app.camunda.com/nexus/content/repositories/camunda-bpm/org/camunda/bpm/distro/camunda-sql-scripts/7.5.0/camunda-sql-scripts-7.5.0.zip

When i start the server, i get the following exception. Do i have to execute other DDLs? Where can i find them?

Greetings
Dennis

SEVERE: ENGINE-16004 Exception while closing command context: ENGINE-03056 Tables are missing for the following components: [
  engine
  history
  identity
  case.engine
  decision.engine
]
org.camunda.bpm.engine.ProcessEngineException: ENGINE-03056 Tables are missing for the following components: [
  engine
  history
  identity
  case.engine
  decision.engine
]
        at org.camunda.bpm.engine.impl.db.EnginePersistenceLogger.missingTableException(EnginePersistenceLogger.java:471)
        at org.camunda.bpm.engine.impl.db.sql.DbSqlSession.dbSchemaCheckVersion(DbSqlSession.java:299)
        at org.camunda.bpm.engine.impl.SchemaOperationsProcessEngineBuild.execute(SchemaOperationsProcessEngineBuild.java:54)
        at org.camunda.bpm.engine.impl.SchemaOperationsProcessEngineBuild.execute(SchemaOperationsProcessEngineBuild.java:34)
        at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
        at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:104)
        at org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor.execute(ProcessApplicationContextInterceptor.java:66)
        at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30)
        at org.camunda.bpm.engine.impl.ProcessEngineImpl.executeSchemaOperations(ProcessEngineImpl.java:126)
        at org.camunda.bpm.engine.impl.ProcessEngineImpl.<init>(ProcessEngineImpl.java:98)
        at org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProcessEngine(ProcessEngineConfigurationImpl.java:613)
        at org.camunda.bpm.container.impl.jmx.services.JmxManagedProcessEngineController.start(JmxManagedProcessEngineController.java:34)
        at org.camunda.bpm.container.impl.jmx.MBeanServiceContainer.startService(MBeanServiceContainer.java:73)
        at org.camunda.bpm.container.impl.jmx.MBeanServiceContainer.startService(MBeanServiceContainer.java:59)
        at org.camunda.bpm.container.impl.deployment.StartProcessEngineStep.performOperationStep(StartProcessEngineStep.java:119)
        at org.camunda.bpm.container.impl.spi.DeploymentOperation.execute(DeploymentOperation.java:114)
        at org.camunda.bpm.container.impl.jmx.MBeanServiceContainer.executeDeploymentOperation(MBeanServiceContainer.java:156)
        at org.camunda.bpm.container.impl.spi.DeploymentOperation$DeploymentOperationBuilder.execute(DeploymentOperation.java:203)
        at org.camunda.bpm.container.impl.tomcat.TomcatBpmPlatformBootstrap.deployBpmPlatform(TomcatBpmPlatformBootstrap.java:72)
        at org.camunda.bpm.container.impl.tomcat.TomcatBpmPlatformBootstrap.lifecycleEvent(TomcatBpmPlatformBootstrap.java:57)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
        at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
        at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:347)
        at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:732)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:689)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:321)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)

Hi Dennis,

this exceptions seems to mean that it didn’t find any table at all. Did you created the Tables with a different prefix or in a different scheme? How does your database configuration of the engine looks like?

Cheers,
Sebastian

Hi Sebastian,

thanks for the quick response.

Yes, i use a scheme named TDS.

This ist my bpm-platform.xml:

<?xml version="1.0" encoding="UTF-8" ?>
<bpm-platform xmlns="http://www.camunda.org/schema/1.0/BpmPlatform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.camunda.org/schema/1.0/BpmPlatformhttp://www.camunda.org/schema/1.0/BpmPlatform">

  <job-executor>
    <job-acquisition name="default" />
  </job-executor>

  <process-engine name="default">
    <job-acquisition>default</job-acquisition>
    <configuration>org.camunda.bpm.engine.impl.cfg.StandaloneProcessEngineConfiguration</configuration>
    <datasource>java:jdbc/ProcessEngine</datasource>

    <properties>
      <property name="history">full</property>
      <property name="databaseSchemaUpdate">false</property> <!-- manuelle Anlage in DB2 -->
      <property name="authorizationEnabled">true</property>
      <property name="jobExecutorDeploymentAware">true</property>
      <property name="databaseTablePrefix">TDS.</property> 
    </properties>

    <plugins>
      <!-- plugin enabling Process Application event listener support -->
      <plugin>
        <class>org.camunda.bpm.application.impl.event.ProcessApplicationEventListenerPlugin</class>
      </plugin>
      
      <!-- plugin enabling integration of camunda Spin -->
      <plugin>
        <class>org.camunda.spin.plugin.impl.SpinProcessEnginePlugin</class>
      </plugin>

      <!-- plugin enabling connect support -->
      <plugin>
        <class>org.camunda.connect.plugin.impl.ConnectProcessEnginePlugin</class>
      </plugin>

 
    </plugins> 

  </process-engine>

</bpm-platform>

My Server.xml:

<?xml version='1.0' encoding='utf-8'?>
<Resource name="jdbc/ProcessEngine"
          auth="Container"
          type="javax.sql.DataSource" 
          factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
          uniqueResourceName="process-engine"
          driverClassName="com.ibm.db2.jcc.DB2Driver" 
          url="jdbc:db2://xxxxxxxxx:xxxxx/xxxxxxx"
          username="xxxxxxx"  
          password="xxxxxxx"
          maxActive="20"
          minIdle="5" /> 
<Resource name="global/camunda-bpm-platform/process-engine/ProcessEngineService!org.camunda.bpm.ProcessEngineService" auth="Container"
          type="org.camunda.bpm.ProcessEngineService"
          description="camunda BPM platform Process Engine Service"
          factory="org.camunda.bpm.container.impl.jndi.ProcessEngineServiceObjectFactory" />
          
<Resource name="global/camunda-bpm-platform/process-engine/ProcessApplicationService!org.camunda.bpm.ProcessApplicationService" auth="Container"
          type="org.camunda.bpm.ProcessApplicationService"
          description="camunda BPM platform Process Application Service"
          factory="org.camunda.bpm.container.impl.jndi.ProcessApplicationServiceObjectFactory" />
<!--The connectors can use a shared executor, you can define one or more named thread pools-->
<!--
<Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
    maxThreads="150" minSpareThreads="4"/>
-->
<!-- A "Connector" represents an endpoint by which requests are received
     and responses are returned. Documentation at :
     Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
     Java AJP  Connector: /docs/config/ajp.html
     APR (HTTP/AJP) Connector: /docs/apr.html
     Define a non-SSL HTTP/1.1 Connector on port 8080
-->
<Connector port="8080" protocol="HTTP/1.1"
           connectionTimeout="20000"
           redirectPort="8443" />
<!-- A "Connector" using the shared thread pool-->
<!--
<Connector executor="tomcatThreadPool"
           port="8080" protocol="HTTP/1.1"
           connectionTimeout="20000"
           redirectPort="8443" />
-->
<!-- Define a SSL HTTP/1.1 Connector on port 8443
     This connector uses the JSSE configuration, when using APR, the
     connector should be using the OpenSSL style configuration
     described in the APR documentation -->
<!--
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
           maxThreads="150" scheme="https" secure="true"
           clientAuth="false" sslProtocol="TLS" />
-->
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
<!-- An Engine represents the entry point (within Catalina) that processes
     every request.  The Engine implementation for Tomcat stand alone
     analyzes the HTTP headers included with the request, and passes them
     on to the appropriate Host (virtual host).
     Documentation at /docs/config/engine.html -->
<!-- You should set jvmRoute to support load-balancing via AJP ie :
<Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
-->
<Engine name="Catalina" defaultHost="localhost">
  <!--For clustering, please take a look at documentation at:
      /docs/cluster-howto.html  (simple how to)
      /docs/config/cluster.html (reference documentation) -->
  <!--
  <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
  -->
  <!-- Use the LockOutRealm to prevent attempts to guess user passwords
       via a brute-force attack -->
  <Realm className="org.apache.catalina.realm.LockOutRealm">
    <!-- This Realm uses the UserDatabase configured in the global JNDI
         resources under the key "UserDatabase".  Any edits
         that are performed against this UserDatabase are immediately
         available for use by the Realm.  -->
    <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
           resourceName="UserDatabase"/>
  </Realm>
  <Host name="localhost"  appBase="webapps"
        unpackWARs="true" autoDeploy="true">
    <!-- SingleSignOn valve, share authentication between web applications
         Documentation at: /docs/config/valve.html -->
    <!--
    <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
    -->
    <!-- Access log processes all example.
         Documentation at: /docs/config/valve.html
         Note: The pattern used is equivalent to using pattern="common" -->
    <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
           prefix="localhost_access_log" suffix=".txt"
           pattern="%h %l %u %t &quot;%r&quot; %s %b" />
  </Host>
</Engine>

List of Tables in scheme TDS:

ACT_GE_BYTEARRAY
ACT_GE_PROPERTY
ACT_HI_ACTINST
ACT_HI_ATTACHMENT
ACT_HI_BATCH
ACT_HI_CASEACTINST
ACT_HI_CASEINST
ACT_HI_COMMENT
ACT_HI_DEC_IN
ACT_HI_DEC_OUT
ACT_HI_DECINST
ACT_HI_DETAIL
ACT_HI_IDENTITYLINK
ACT_HI_INCIDENT
ACT_HI_JOB_LOG
ACT_HI_OP_LOG
ACT_HI_PROCINST
ACT_HI_TASKINST
ACT_HI_VARINST
ACT_ID_GROUP
ACT_ID_INFO
ACT_ID_MEMBERSHIP
ACT_ID_TENANT
ACT_ID_TENANT_MEMBER
ACT_ID_USER
ACT_RE_CASE_DEF
ACT_RE_DECISION_DEF
ACT_RE_DEPLOYMENT
ACT_RE_PROCDEF
ACT_RU_AUTHORIZATION
ACT_RU_BATCH
ACT_RU_CASE_EXECUTION
ACT_RU_CASE_SENTRY_PART
ACT_RU_EVENT_SUBSCR
ACT_RU_EXECUTION
ACT_RU_EXT_TASK
ACT_RU_FILTER
ACT_RU_IDENTITYLINK
ACT_RU_INCIDENT
ACT_RU_JOB
ACT_RU_JOBDEF
ACT_RU_METER_LOG
ACT_RU_TASK
ACT_RU_VARIABLE

When i delete the property databaseTablePrefix, the exceptions looks like this:

Cause: com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=<XXX_NAME_OF_USER>.ACT_GE_PROPERTY, DRIVER=3.65.110

    at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:26)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:111)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:102)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:66)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:61)
    at org.camunda.bpm.engine.impl.db.sql.DbSqlSession.getDbVersion(DbSqlSession.java:318)
    at org.camunda.bpm.engine.impl.db.sql.DbSqlSession.dbSchemaCheckVersion(DbSqlSession.java:276)
    at org.camunda.bpm.engine.impl.SchemaOperationsProcessEngineBuild.execute(SchemaOperationsProcessEngineBuild.java:54)
    at org.camunda.bpm.engine.impl.SchemaOperationsProcessEngineBuild.execute(SchemaOperationsProcessEngineBuild.java:34)
    at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
    at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:104)
    at org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor.execute(ProcessApplicationContextInterceptor.java:66)
    at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30)
    at org.camunda.bpm.engine.impl.ProcessEngineImpl.executeSchemaOperations(ProcessEngineImpl.java:126)
    at org.camunda.bpm.engine.impl.ProcessEngineImpl.<init>(ProcessEngineImpl.java:98)
    at org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProcessEngine(ProcessEngineConfigurationImpl.java:613)
    at org.camunda.bpm.container.impl.jmx.services.JmxManagedProcessEngineController.start(JmxManagedProcessEngineController.java:34)
    at org.camunda.bpm.container.impl.jmx.MBeanServiceContainer.startService(MBeanServiceContainer.java:73)
    at org.camunda.bpm.container.impl.jmx.MBeanServiceContainer.startService(MBeanServiceContainer.java:59)
    at org.camunda.bpm.container.impl.deployment.StartProcessEngineStep.performOperationStep(StartProcessEngineStep.java:119)
    at org.camunda.bpm.container.impl.spi.DeploymentOperation.execute(DeploymentOperation.java:114)
    at org.camunda.bpm.container.impl.jmx.MBeanServiceContainer.executeDeploymentOperation(MBeanServiceContainer.java:156)
    at org.camunda.bpm.container.impl.spi.DeploymentOperation$DeploymentOperationBuilder.execute(DeploymentOperation.java:203)
    at org.camunda.bpm.container.impl.tomcat.TomcatBpmPlatformBootstrap.deployBpmPlatform(TomcatBpmPlatformBootstrap.java:72)
    at org.camunda.bpm.container.impl.tomcat.TomcatBpmPlatformBootstrap.lifecycleEvent(TomcatBpmPlatformBootstrap.java:57)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
    at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
    at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
    at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:347)
    at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:732)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:689)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:321)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)

Caused by: com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=<XXX_NAME_OF_USER>.ACT_GE_PROPERTY, DRIVER=3.65.110
at com.ibm.db2.jcc.am.cd.a(cd.java:698)
at com.ibm.db2.jcc.am.cd.a(cd.java:60)
at com.ibm.db2.jcc.am.cd.a(cd.java:127)
at com.ibm.db2.jcc.am.ko.c(ko.java:2762)
at com.ibm.db2.jcc.am.ko.d(ko.java:2750)
at com.ibm.db2.jcc.am.ko.a(ko.java:2199)
at com.ibm.db2.jcc.am.lo.a(lo.java:7387)
at com.ibm.db2.jcc.t4.bb.h(bb.java:140)
at com.ibm.db2.jcc.t4.bb.b(bb.java:40)
at com.ibm.db2.jcc.t4.q.a(q.java:32)
at com.ibm.db2.jcc.t4.rb.i(rb.java:135)
at com.ibm.db2.jcc.am.ko.gb(ko.java:2168)
at com.ibm.db2.jcc.am.lo.sc(lo.java:3548)
at com.ibm.db2.jcc.am.lo.b(lo.java:4346)
at com.ibm.db2.jcc.am.lo.ic(lo.java:2745)
at com.ibm.db2.jcc.am.lo.execute(lo.java:2725)
at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:59)
at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:73)
at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:60)
at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:267)
at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:137)
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:96)
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:77)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:108)
… 36 more

Greetings
Dennis

When using a schema, in addition to databaseTablePrefix make sure to set the engine configuration property databaseSchema to the schema’s name.

Cheers,
Thorben

Hi,

I added the property databaseSchema. That solves the problem.

Many thanks!

Greetings
Dennis

Hi guys,

I just ran into the same problem with PostgreSQL and databaseSchema doesn’t seem to be documented anywhere. Maybe this could be added to the docs.

Also, this example doesn’t work without setting the property:

https://docs.camunda.org/manual/7.5/user-guide/process-engine/multi-tenancy/#example-configuration-for-schema-isolation

Still, I am wondering if that used to work without setting the property in earlier versions. Also, this seems to be a bit repetitive to me as I already state the schema with [prefix]+'.' I’d be interested in the motivation behind this implementation, if you are in the mood :wink:

Cheers, Ben

1 Like

Hi,
Can you please share your engine configuration code in which you set the property databaseSchema.

Thanks,
Alok