Reputation: 148
I have a simple cammunda
spring boot application. which I want to run in a docker container
I am able to run it locally from IntelliJ
but when I try to run it inside a docker it fails with below error message:
08043 Exception while performing 'Deployment of Process Application camundaApplication' => 'Deployment of process archive 'ct-camunda': The deployment contains definitions with the same key 'ct-camunda' (id attribute), this is not allowed
docker-compose.yml
version: '2'
services:
myaap:
build: .
ports:
- "8080:8080"
processes.yml
<process-application xmlns="http://www.camunda.org/schema/1.0/ProcessApplication">
<process-engine name="my-engine">
<configuration>org.camunda.bpm.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration</configuration>
</process-engine>
<process-archive name="ct-camunda" tenantId="ct-camunda">
<process-engine>default</process-engine>
<resource>ct-camunda.bpmn</resource>
<properties>
<property name="isDeleteUponUndeploy">false</property>
<property name="isScanForProcessDefinitions">true</property>
</properties>
</process-archive>
</process-application>
Dockerfile
FROM openjdk:11
ARG JAR_FILE=target/camunda-0.0.1-SNAPSHOT-exec.jar
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-jar","/app.jar"]
Main class CamundaApplication.java
@SpringBootApplication
@EnableProcessApplication
public class CamundaApplication {
public static void main(String[] args) {
SpringApplication.run(CamundaApplication.class, args);
}
}
Error logs:
2022-02-25 03:21:24.724 INFO 1 --- [ main] org.camunda.bpm.container : ENGINE-08023 Deployment summary for process archive 'ct-camunda':
ct-camunda.bpmn
BOOT-INF/classes/ct-camunda.bpmn
2022-02-25 03:21:25.067 ERROR 1 --- [ main] org.camunda.bpm.engine.context : ENGINE-16004 Exception while closing command context: The deployment contains definitions with the same key 'ct-camunda' (id attribute), this is not allowed
org.camunda.bpm.engine.ProcessEngineException: The deployment contains definitions with the same key 'ct-camunda' (id attribute), this is not allowed
at org.camunda.bpm.engine.impl.AbstractDefinitionDeployer.ensureNoDuplicateDefinitionKeys(AbstractDefinitionDeployer.java:192) ~[camunda-engine-7.16.0.jar!/:7.16.0]
at org.camunda.bpm.engine.impl.AbstractDefinitionDeployer.deploy(AbstractDefinitionDeployer.java:65) ~[camunda-engine-7.16.0.jar!/:7.16.0]
at org.camunda.bpm.engine.impl.persistence.deploy.cache.CacheDeployer$1.call(CacheDeployer.java:54) ~[camunda-engine-7.16.0.jar!/:7.16.0]
at org.camunda.bpm.engine.impl.persistence.deploy.cache.CacheDeployer$1.call(CacheDeployer.java:51) ~[camunda-engine-7.16.0.jar!/:7.16.0]
at org.camunda.bpm.engine.impl.interceptor.CommandContext.runWithoutAuthorization(CommandContext.java:559) ~[camunda-engine-7.16.0.jar!/:7.16.0]
at org.camunda.bpm.engine.impl.interceptor.CommandContext.runWithoutAuthorization(CommandContext.java:547) ~[camunda-engine-7.16.0.jar!/:7.16.0]
at org.camunda.bpm.engine.impl.persistence.deploy.cache.CacheDeployer.deploy(CacheDeployer.java:51) ~[camunda-engine-7.16.0.jar!/:7.16.0]
at org.camunda.bpm.engine.impl.persistence.deploy.cache.DeploymentCache.deploy(DeploymentCache.java:71) ~[camunda-engine-7.16.0.jar!/:7.16.0]
at org.camunda.bpm.engine.impl.persistence.entity.DeploymentManager.insertDeployment(DeploymentManager.java:64) ~[camunda-engine-7.16.0.jar!/:7.16.0]
at org.camunda.bpm.engine.impl.cmd.DeployCmd.deploy(DeployCmd.java:254) ~[camunda-engine-7.16.0.jar!/:7.16.0]
at org.camunda.bpm.engine.impl.cmd.DeployCmd.lambda$doExecute$0(DeployCmd.java:155) ~[camunda-engine-7.16.0.jar!/:7.16.0]
at org.camunda.bpm.engine.impl.interceptor.CommandContext.runWithoutAuthorization(CommandContext.java:559) ~[camunda-engine-7.16.0.jar!/:7.16.0]
at org.camunda.bpm.engine.impl.interceptor.CommandContext.runWithoutAuthorization(CommandContext.java:547) ~[camunda-engine-7.16.0.jar!/:7.16.0]
at org.camunda.bpm.engine.impl.cmd.DeployCmd.doExecute(DeployCmd.java:141) ~[camunda-engine-7.16.0.jar!/:7.16.0]
at org.camunda.bpm.engine.impl.cmd.DeployCmd.execute(DeployCmd.java:101) ~[camunda-engine-7.16.0.jar!/:7.16.0]
at org.camunda.bpm.engine.impl.cmd.DeployCmd.execute(DeployCmd.java:81) ~[camunda-engine-7.16.0.jar!/:7.16.0]
at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:28) ~[camunda-engine-7.16.0.jar!/:7.16.0]
at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:110) ~[camunda-engine-7.16.0.jar!/:7.16.0]
at org.camunda.bpm.engine.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:72) ~[camunda-engine-spring-7.16.0.jar!/:7.16.0]
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140) ~[spring-tx-5.3.9.jar!/:5.3.9]
at org.camunda.bpm.engine.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:70) ~[camunda-engine-spring-7.16.0.jar!/:7.16.0]
at org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor.execute(ProcessApplicationContextInterceptor.java:70) ~[camunda-engine-7.16.0.jar!/:7.16.0]
at org.camunda.bpm.engine.impl.interceptor.CommandCounterInterceptor.execute(CommandCounterInterceptor.java:35) ~[camunda-engine-7.16.0.jar!/:7.16.0]
at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33) ~[camunda-engine-7.16.0.jar!/:7.16.0]
at org.camunda.bpm.engine.impl.RepositoryServiceImpl.deployWithResult(RepositoryServiceImpl.java:104) ~[camunda-engine-7.16.0.jar!/:7.16.0]
at org.camunda.bpm.engine.impl.repository.DeploymentBuilderImpl.deployWithResult(DeploymentBuilderImpl.java:270) ~[camunda-engine-7.16.0.jar!/:7.16.0]
at org.camunda.bpm.engine.impl.repository.DeploymentBuilderImpl.deploy(DeploymentBuilderImpl.java:266) ~[camunda-engine-7.16.0.jar!/:7.16.0]
at org.camunda.bpm.engine.impl.repository.ProcessApplicationDeploymentBuilderImpl.deploy(ProcessApplicationDeploymentBuilderImpl.java:63) ~[camunda-engine-7.16.0.jar!/:7.16.0]
at org.camunda.bpm.container.impl.deployment.DeployProcessArchiveStep.performOperationStep(DeployProcessArchiveStep.java:146) ~[camunda-engine-7.16.0.jar!/:7.16.0]
at org.camunda.bpm.container.impl.spi.DeploymentOperation.execute(DeploymentOperation.java:120) ~[camunda-engine-7.16.0.jar!/:7.16.0]
at org.camunda.bpm.container.impl.jmx.MBeanServiceContainer.executeDeploymentOperation(MBeanServiceContainer.java:160) ~[camunda-engine-7.16.0.jar!/:7.16.0]
at org.camunda.bpm.container.impl.spi.DeploymentOperation$DeploymentOperationBuilder.execute(DeploymentOperation.java:216) ~[camunda-engine-7.16.0.jar!/:7.16.0]
at org.camunda.bpm.container.impl.RuntimeContainerDelegateImpl.deployProcessApplication(RuntimeContainerDelegateImpl.java:102) ~[camunda-engine-7.16.0.jar!/:7.16.0]
at org.camunda.bpm.application.AbstractProcessApplication.deploy(AbstractProcessApplication.java:71) ~[camunda-engine-7.16.0.jar!/:7.16.0]
at org.camunda.bpm.engine.spring.application.SpringProcessApplication.start(SpringProcessApplication.java:110) ~[camunda-engine-spring-7.16.0.jar!/:7.16.0]
at org.camunda.bpm.engine.spring.application.SpringProcessApplication.afterPropertiesSet(SpringProcessApplication.java:119) ~[camunda-engine-spring-7.16.0.jar!/:7.16.0]
at org.camunda.bpm.spring.boot.starter.SpringBootProcessApplication.afterPropertiesSet(SpringBootProcessApplication.java:102) ~[camunda-bpm-spring-boot-starter-7.16.0.jar!/:7.16.0]
at org.camunda.bpm.engine.spring.application.SpringProcessApplication.onApplicationEvent(SpringProcessApplication.java:96) ~[camunda-engine-spring-7.16.0.jar!/:7.16.0]
at org.camunda.bpm.engine.spring.application.SpringProcessApplication.onApplicationEvent(SpringProcessApplication.java:52) ~[camunda-engine-spring-7.16.0.jar!/:7.16.0]
at org.camunda.bpm.spring.boot.starter.SpringBootProcessApplication$$EnhancerBySpringCGLIB$$595e572.onApplicationEvent(<generated>) ~[camunda-bpm-spring-boot-starter-7.16.0.jar!/:7.16.0]
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176) ~[spring-context-5.3.9.jar!/:5.3.9]
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169) ~[spring-context-5.3.9.jar!/:5.3.9]
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143) ~[spring-context-5.3.9.jar!/:5.3.9]
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:421) ~[spring-context-5.3.9.jar!/:5.3.9]
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:378) ~[spring-context-5.3.9.jar!/:5.3.9]
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:938) ~[spring-context-5.3.9.jar!/:5.3.9]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:586) ~[spring-context-5.3.9.jar!/:5.3.9]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.5.4.jar!/:2.5.4]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) ~[spring-boot-2.5.4.jar!/:2.5.4]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434) ~[spring-boot-2.5.4.jar!/:2.5.4]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:338) ~[spring-boot-2.5.4.jar!/:2.5.4]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343) ~[spring-boot-2.5.4.jar!/:2.5.4]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1332) ~[spring-boot-2.5.4.jar!/:2.5.4]
at com.nk.ct.camunda.CamundaApplication.main(CamundaApplication.java:12) ~[classes!/:0.0.1-SNAPSHOT]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) ~[app.jar:0.0.1-SNAPSHOT]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:108) ~[app.jar:0.0.1-SNAPSHOT]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) ~[app.jar:0.0.1-SNAPSHOT]
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88) ~[app.jar:0.0.1-SNAPSHOT]
2022-02-25 03:21:25.090 INFO 1 --- [ main] org.camunda.bpm.engine.jobexecutor : ENGINE-14015 Shutting down the JobExecutor[org.camunda.bpm.engine.impl.jobexecutor.DefaultJobExecutor]
2022-02-25 03:21:25.091 INFO 1 --- [ultJobExecutor]] org.camunda.bpm.engine.jobexecutor : ENGINE-14020 JobExecutor[org.camunda.bpm.engine.impl.jobexecutor.DefaultJobExecutor] stopped job acquisition
2022-02-25 03:21:25.111 INFO 1 --- [ main] org.camunda.bpm.engine.persistence : ENGINE-03016 Performing database operation 'drop' on component 'decision.engine' with resource 'org/camunda/bpm/engine/db/drop/activiti.h2.drop.decision.engine.sql'
2022-02-25 03:21:25.126 INFO 1 --- [ main] org.camunda.bpm.engine.persistence : ENGINE-03016 Performing database operation 'drop' on component 'decision.history' with resource 'org/camunda/bpm/engine/db/drop/activiti.h2.drop.decision.history.sql'
2022-02-25 03:21:25.138 INFO 1 --- [ main] org.camunda.bpm.engine.persistence : ENGINE-03016 Performing database operation 'drop' on component 'case.engine' with resource 'org/camunda/bpm/engine/db/drop/activiti.h2.drop.case.engine.sql'
2022-02-25 03:21:25.185 INFO 1 --- [ main] org.camunda.bpm.engine.persistence : ENGINE-03016 Performing database operation 'drop' on component 'engine' with resource 'org/camunda/bpm/engine/db/drop/activiti.h2.drop.engine.sql'
2022-02-25 03:21:25.191 INFO 1 --- [ main] org.camunda.bpm.engine.persistence : ENGINE-03016 Performing database operation 'drop' on component 'case.history' with resource 'org/camunda/bpm/engine/db/drop/activiti.h2.drop.case.history.sql'
2022-02-25 03:21:25.224 INFO 1 --- [ main] org.camunda.bpm.engine.persistence : ENGINE-03016 Performing database operation 'drop' on component 'history' with resource 'org/camunda/bpm/engine/db/drop/activiti.h2.drop.history.sql'
2022-02-25 03:21:25.233 INFO 1 --- [ main] org.camunda.bpm.engine.persistence : ENGINE-03016 Performing database operation 'drop' on component 'identity' with resource 'org/camunda/bpm/engine/db/drop/activiti.h2.drop.identity.sql'
2022-02-25 03:21:25.236 INFO 1 --- [ main] org.camunda.bpm.engine : ENGINE-00007 Process Engine my-engine closed
2022-02-25 03:21:25.250 INFO 1 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2022-02-25 03:21:25.265 INFO 1 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2022-02-25 03:21:25.303 ERROR 1 --- [ main] o.s.boot.SpringApplication : Application run failed
java.lang.RuntimeException: org.camunda.bpm.engine.ProcessEngineException: ENGINE-08043 Exception while performing 'Deployment of Process Application camundaApplication' => 'Deployment of process archive 'ct-camunda': The deployment contains definitions with the same key 'ct-camunda' (id attribute), this is not allowed
at org.camunda.bpm.engine.spring.application.SpringProcessApplication.onApplicationEvent(SpringProcessApplication.java:105) ~[camunda-engine-spring-7.16.0.jar!/:7.16.0]
at org.camunda.bpm.engine.spring.application.SpringProcessApplication.onApplicationEvent(SpringProcessApplication.java:52) ~[camunda-engine-spring-7.16.0.jar!/:7.16.0]
at org.camunda.bpm.spring.boot.starter.SpringBootProcessApplication$$EnhancerBySpringCGLIB$$595e572.onApplicationEvent(<generated>) ~[camunda-bpm-spring-boot-starter-7.16.0.jar!/:7.16.0]
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176) ~[spring-context-5.3.9.jar!/:5.3.9]
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169) ~[spring-context-5.3.9.jar!/:5.3.9]
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143) ~[spring-context-5.3.9.jar!/:5.3.9]
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:421) ~[spring-context-5.3.9.jar!/:5.3.9]
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:378) ~[spring-context-5.3.9.jar!/:5.3.9]
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:938) ~[spring-context-5.3.9.jar!/:5.3.9]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:586) ~[spring-context-5.3.9.jar!/:5.3.9]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.5.4.jar!/:2.5.4]
Upvotes: 1
Views: 1904
Reputation: 7583
I don't think this is Docker related. Maybe your build process copies files?
"The deployment contains definitions with the same key 'ct-camunda' (id attribute), this is not allowed" Check if you have packaged multiple .bpmn files into your deployment. Maybe you accidentally copied the model file in an additional classpath location. You seem to have two deployments with the same id. (This is not about the filename, but the technical id used inside the XML)
If you are using auto deployment in Spring Boot, you do not have to declare anything in the processes.xml. Use this only in combination with @EnableProcessApplication (or do not use both)
Upvotes: 2