如何使用Spring Boots application.properties更改camunda bpmn引擎名称?

时间:2019-01-11 07:36:41

标签: spring-boot camunda application.properties

我们有一个大型的Spring Boot应用程序,该应用程序应该具有集成的Camunda BPMN引擎。所谓集成,是指整个应用程序和引擎位于单个WAR文件中,并已部署到tomcat。我已经做好所有工作,直到在一个单独的tomcat上拥有两个这样的WAR文件。为了避免不同的camunda引擎发生冲突,我为两个引擎中的每个引擎配置了不同的数据源。现在发生的是,第二个war文件的部署失败,但出现以下异常,告诉我该实例已存在:

Caused by: javax.management.InstanceAlreadyExistsException: org.camunda.bpm.platform.process-engine:type=default
at com.sun.jmx.mbeanserver.Repository.addMBean(Repository.java:437)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerWithRepository(DefaultMBeanServerInterceptor.java:1898)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:966)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:900)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:324)
at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522)
at org.camunda.bpm.container.impl.jmx.MBeanServiceContainer.startService(MBeanServiceContainer.java:79)
... 65 more

为避免该错误,我尝试在application.properties中重命名引擎:

camunda.bpm.process-engine-name=demo

现在这会导致另一个异常,我不知道如何解决:

Caused by: org.camunda.bpm.engine.exception.NullValueException: Cannot deploy process archive 'null' to default process: no such process engine exists: processEngine is null
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_191]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_191]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_191]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_191]
at org.camunda.bpm.engine.impl.util.EnsureUtil.generateException(EnsureUtil.java:380) ~[camunda-engine-7.10.0.jar:7.10.0]
at org.camunda.bpm.engine.impl.util.EnsureUtil.ensureNotNull(EnsureUtil.java:54) ~[camunda-engine-7.10.0.jar:7.10.0]
at org.camunda.bpm.engine.impl.util.EnsureUtil.ensureNotNull(EnsureUtil.java:49) ~[camunda-engine-7.10.0.jar:7.10.0]
at org.camunda.bpm.container.impl.deployment.DeployProcessArchiveStep.getProcessEngine(DeployProcessArchiveStep.java:217) ~[camunda-engine-7.10.0.jar:7.10.0]
at org.camunda.bpm.container.impl.deployment.DeployProcessArchiveStep.performOperationStep(DeployProcessArchiveStep.java:81) ~[camunda-engine-7.10.0.jar:7.10.0]
at org.camunda.bpm.container.impl.spi.DeploymentOperation.execute(DeploymentOperation.java:119) ~[camunda-engine-7.10.0.jar:7.10.0]
at org.camunda.bpm.container.impl.jmx.MBeanServiceContainer.executeDeploymentOperation(MBeanServiceContainer.java:159) ~[camunda-engine-7.10.0.jar:7.10.0]
at org.camunda.bpm.container.impl.spi.DeploymentOperation$DeploymentOperationBuilder.execute(DeploymentOperation.java:215) ~[camunda-engine-7.10.0.jar:7.10.0]
at org.camunda.bpm.container.impl.RuntimeContainerDelegateImpl.deployProcessApplication(RuntimeContainerDelegateImpl.java:101) ~[camunda-engine-7.10.0.jar:7.10.0]
at org.camunda.bpm.application.AbstractProcessApplication.deploy(AbstractProcessApplication.java:62) ~[camunda-engine-7.10.0.jar:7.10.0]
at org.camunda.bpm.engine.spring.application.SpringProcessApplication.start(SpringProcessApplication.java:109) ~[camunda-engine-spring-7.10.0.jar:7.10.0]
at org.camunda.bpm.engine.spring.application.SpringProcessApplication.afterPropertiesSet(SpringProcessApplication.java:118) ~[camunda-engine-spring-7.10.0.jar:7.10.0]
at org.camunda.bpm.spring.boot.starter.SpringBootProcessApplication.afterPropertiesSet(SpringBootProcessApplication.java:90) ~[camunda-bpm-spring-boot-starter-3.2.0.jar:3.2.0]
at org.camunda.bpm.engine.spring.application.SpringProcessApplication.onApplicationEvent(SpringProcessApplication.java:95) ~[camunda-engine-spring-7.10.0.jar:7.10.0]
... 21 more

一些技术细节。我们使用:

  • Spring Boot 2.1.1
  • 嵌入式Tomcat 9.0.13
  • Camunda BPM Spring Boot Starter 3.2.0
  • MariaDB 10.3.11
  • Camundas META-INF / processes.xml为空

所以我基本上有两个问题:

  • 如何使用application.properties文件重命名Camunda BMPN引擎?
  • 如何最好只使用Spring Boot和application.properties文件在同一个tomcat上运行两个完整的独立引擎实例?

奖金问题:

  • 是否可以将两个引擎实例配置为在同一数据源上运行?

0 个答案:

没有答案