Evaluate within JavaDelegate:

We experience an error evaluating a dmn within our process in a JavaDelegate (Service Task).
UnitTest works correctly. Evaluation as expected.
In deployed process it doesn’t. See stack trace below.

In the JavaDelegate we use the injected DecisionService. The evaluation was executed. I see an entry in the database. But something happens on returning the result.

Also we don’t receive errors using the DmnEngine directly (not over DecisionService). But in this case there is no link to current process.

Did anyone else have the same problem?

Stack trace:
java.lang.RuntimeException: org.jboss.resteasy.spi.UnhandledException: java.lang.LinkageError: loader constraint violation: when resolving interface method "org.camunda.bpm.engine.DecisionService.evaluateDecisionTableById(Ljava/lang/String;Ljava/util/Map;)Lorg/camunda/bpm/dmn/engine/DmnDecisionTableResult;" the class loader (instance of org/apache/catalina/loader/WebappClassLoader) of the current class, de/project/delegates/SomeJavaDelegate, and the class loader (instance of java/net/URLClassLoader) for the method's defining class, org/camunda/bpm/engine/DecisionService, have different Class objects for the type org/camunda/bpm/dmn/engine/DmnDecisionTableResult used in the signature at org.camunda.bpm.webapp.impl.security.auth.AuthenticationFilter$1.execute(AuthenticationFilter.java:61) at org.camunda.bpm.webapp.impl.security.auth.AuthenticationFilter$1.execute(AuthenticationFilter.java:56) at org.camunda.bpm.webapp.impl.security.SecurityActions.runWithAuthentications(SecurityActions.java:38) at org.camunda.bpm.webapp.impl.security.auth.AuthenticationFilter.doFilter(AuthenticationFilter.java:56) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:617) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1527) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1484) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) Caused by: org.jboss.resteasy.spi.UnhandledException: java.lang.LinkageError: loader constraint violation: when resolving interface method "org.camunda.bpm.engine.DecisionService.evaluateDecisionTableById(Ljava/lang/String;Ljava/util/Map;)Lorg/camunda/bpm/dmn/engine/DmnDecisionTableResult;" the class loader (instance of org/apache/catalina/loader/WebappClassLoader) of the current class, de/project/delegates/SomeJavaDelegate, and the class loader (instance of java/net/URLClassLoader) for the method's defining class, org/camunda/bpm/engine/DecisionService, have different Class objects for the type org/camunda/bpm/dmn/engine/DmnDecisionTableResult used in the signature at org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:365) at org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:233) at org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:209) at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:557) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:524) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:126) at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.camunda.bpm.engine.rest.filter.CacheControlFilter.doFilter(CacheControlFilter.java:41) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.camunda.bpm.webapp.impl.security.filter.SecurityFilter.doFilterSecure(SecurityFilter.java:67) at org.camunda.bpm.webapp.impl.security.filter.SecurityFilter.doFilter(SecurityFilter.java:51) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.camunda.bpm.webapp.impl.security.auth.AuthenticationFilter$1.execute(AuthenticationFilter.java:59) ... 21 more Caused by: java.lang.LinkageError: loader constraint violation: when resolving interface method "org.camunda.bpm.engine.DecisionService.evaluateDecisionTableById(Ljava/lang/String;Ljava/util/Map;)Lorg/camunda/bpm/dmn/engine/DmnDecisionTableResult;" the class loader (instance of org/apache/catalina/loader/WebappClassLoader) of the current class, de/project/delegates/SomeJavaDelegate, and the class loader (instance of java/net/URLClassLoader) for the method's defining class, org/camunda/bpm/engine/DecisionService, have different Class objects for the type org/camunda/bpm/dmn/engine/DmnDecisionTableResult used in the signature ...

I can’t really help you with your class loader issue but:
why you’re calling your Decision Table this way?
Why not us a Business Rule Task directly instead of a Service Task and a Java Delegate?

See https://docs.camunda.org/manual/7.5/reference/bpmn20/tasks/business-rule-task/.

We are also using business rule tasks. But we also want to evaluate during some other business logic the dmn.

hi @pagluc,

could you share your pom file?

Cheers,
Askar

hi @aakhmerov thx for request.


4.0.0

<groupId>com.company</groupId>
<artifactId>projectname</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <java.version>1.8</java.version>
    <camunda.version>7.5.2-ee</camunda.version>
    <spring.version>3.1.2.RELEASE</spring.version>
    <cxf.version>3.1.6</cxf.version>
    <jackson.version>1.9.13</jackson.version>
    <failOnMissingWebXml>false</failOnMissingWebXml>
</properties>
<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.camunda.bpm</groupId>
            <artifactId>camunda-bom</artifactId>
            <version>${camunda.version}</version>
            <scope>import</scope>
            <type>pom</type>
        </dependency>
        <dependency>
            <groupId>org.camunda.bpm.dmn</groupId>
            <artifactId>camunda-engine-dmn-bom</artifactId>
            <version>${camunda.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>
<dependencies>
    <dependency>
        <groupId>org.camunda.bpm</groupId>
        <artifactId>camunda-engine</artifactId>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.camunda.bpm</groupId>
        <artifactId>camunda-engine-spring</artifactId>
    </dependency>
    <dependency>
        <groupId>org.camunda.bpm.dmn</groupId>
        <artifactId>camunda-engine-dmn</artifactId>
    </dependency>
    <dependency>
        <groupId>org.camunda.spin</groupId>
        <artifactId>camunda-spin-core</artifactId>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.camunda.spin</groupId>
        <artifactId>camunda-spin-dataformat-json-jackson</artifactId>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.camunda.bpm</groupId>
        <artifactId>camunda-engine-plugin-spin</artifactId>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>3.1.0</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-rt-frontend-jaxrs</artifactId>
        <version>${cxf.version}</version>
    </dependency>
    <dependency>
        <groupId>org.codehaus.jackson</groupId>
        <artifactId>jackson-jaxrs</artifactId>
        <version>${jackson.version}</version>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>1.7.5</version>
    </dependency>
    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>3.4</version>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.camunda.bpm.extension</groupId>
        <artifactId>camunda-bpm-assert</artifactId>
        <version>1.2</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>com.h2database</groupId>
        <artifactId>h2</artifactId>
        <version>1.3.168</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-test</artifactId>
        <version>${spring.version}</version>
        <scope>test</scope>
    </dependency>
</dependencies>
<build>
    ...
</build>

@pagluc,

thanks for info, could you also tell me your engine version on application server and what kind of AS are you using? jBoss?

Cheers,
Askar.

@aakhmerov thank you for help.
We are using Tomcat bundled with Camunda 7.5.2-ee. The engine libraries are shipped altogether, we didn’t change any library.
Tomcat Version: 8.0.24
Seems there is a conflict in Versions.

Hi @pagluc,

The camunda-engine-dmn dependency should be in provided scope. It is already in the global Tomcat lib folder.

Cheers,
Thorben

1 Like