Definition of ExecutionListeners, error because same name already registered

Definition of ExecutionListeners does not work (7.6-alpha1, Oracle 12c, Tomcat 8.32, Java 8_92)
I just want to initialize some global default variables right at process start

DOCU used:
https://docs.camunda.org/manual/latest/user-guide/process-engine/delegation-code/

my BPM:

bpmn:startEvent id=“StartEvent” name=“inspection required”>
bpmn:extensionElements>
camunda:executionListener class=“net.steelcase.bpm.p021.impl.InitVars4GW” event=“end” />
/bpmn:extensionElements>
bpmn:outgoing>sfw1 /bpmn:outgoing>
/bpmn:startEvent>

my Java-Code:
package net.steelcase.bpm.p021.impl;

import java.util.logging.Logger;

import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.ExecutionListener;
import org.camunda.bpm.engine.variable.VariableMap;
import org.camunda.bpm.engine.variable.Variables;

public class InitVars4GW implements ExecutionListener {
private final Logger LOGGER = Logger.getLogger(this.getClass().getName());

public void notify(DelegateExecution pExecutionDelegate) throws Exception {
    
    LOGGER.info("... InitVars4GW.notify");

    return;
}

}

ERROR:
06-Jul-2016 19:48:20.911 SEVERE [localhost-startStop-6] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class net.steelcase.bpm.p021.impl.QualityInspectorProcess
org.camunda.bpm.engine.ProcessEngineException: ENGINE-08043 Exception while performing ‘Deployment of Process Application Quality Inspector’ => ‘Start Process Application Service’: Cannot register service org.camunda.bpm.platform.job-executor.process-application:type=Quality Inspector with MBeans Container, service with same name already registered.

Thanks, Peter

Hi Peter,

This sounds like it is not related to the execution listener, but rather that you have two process applications deployed that have the same name (Quality Inspector). Could this be the case?

Cheers,
Thorben

Hi Thorben,
not really, I deleted (deployment in Cockpit and Undeploy in Tomcat) everything but the Quality Inspector. Than I deployed it again. I tried even restarting Tomcat between that steps. The Error messages points at a problem at Tomcat level, it sounds like camunda engine tries to register the ExecutionListener twice - or - the ExecutionListener is not deleted during undeploying.
Today I have a totally new installation of Tomcat 8.36 and I’ll try from the very beginning and report how it works or not :slight_smile:
Thanks, Cheers,
Peter

Hi Peter,

I’m pretty sure this has nothing to do with the execution listener. The exception is thrown when the BPM platform tries to register an MBean when the process application is deployed. The corresponding code line is this: https://github.com/camunda/camunda-bpm-platform/blob/7.6.0-alpha2/engine/src/main/java/org/camunda/bpm/container/impl/deployment/StartProcessApplicationServiceStep.java#L67

The platform registers an MBean for every process application based on the process application’s name. That happens regardless whether your processes use execution listeners or not. The registration fails here because an MBean with the same name is apparently already registered. Perhaps a previous undeployment was unsuccessful, so that the MBean was not deregistered before.

Cheers,
Thorben

Hi Thorben,
I tried now with <bpmn:process id=“quality-inspector” name=“Quality Inspector Plant RHM” isExecutable=“true”>
bpmn:extensionElements>
camunda:executionListener class=“net.steelcase.bpm.plant.rhm.p021.impl.ProcessExecutionListener” event=“start” />
/bpmn:extensionElements>

That is working.
By the way, what is the most stable recommended version today? I need a most stable version for a pilot showing my manager, that we can go with camunda enterprise :slight_smile:
Thanks, Cheers,
Peter

Hi Peter,

For the community edition, the download page shows the latest versions, i.e. the latest minor version and the latest alpha of the next minor version. I consider both of them stable, an alpha however may contain new, unfinished features.

Given you have enterprise edition access, you can find the latest patch releases here: https://docs.camunda.org/enterprise/download/#full-distributions-and-standalone-web-applications-of-the-enterprise-edition

Cheers,
Thorben

Hi Thorben,
Thanks!
Cheers,
Peter