Camunda 应用程序未在 docker 容器上启动

Camunda Application not starting up on docker container

我有一个简单的 cammunda spring 启动应用程序。我想 运行 在 docker 容器中

我可以从 IntelliJ 在本地 运行 但是当我尝试在 docker 中 运行 它时失败并显示以下错误消息:

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"]

主要classCamundaApplication.java

@SpringBootApplication
@EnableProcessApplication
public class CamundaApplication {

    public static void main(String[] args) {
        SpringApplication.run(CamundaApplication.class, args);
    }
}

错误日志:

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.call(CacheDeployer.java:54) ~[camunda-engine-7.16.0.jar!/:7.16.0]

at org.camunda.bpm.engine.impl.persistence.deploy.cache.CacheDeployer.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[=15=](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.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$5e572.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$5e572.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]

我认为这与 Docker 无关。也许您的构建过程会复制文件?

“部署包含具有相同键 'ct-camunda'(id 属性)的定义,这是不允许的” 检查您是否已将多个 .bpmn 文件打包到您的部署中。也许您不小心将模型文件复制到其他类路径位置。您似乎有两个具有相同 ID 的部署。 (这与文件名无关,而是 XML 中使用的技术 ID)

如果您在 Spring 引导中使用自动部署,则不必在 processes.xml 中声明任何内容。仅将此与 @EnableProcessApplication 结合使用(或不要同时使用)