Starting a DMN Engine in a Bean does not work

I will build a DMN Engine in a Bean. DMN Engine with a BPMN Business Rule Task works fine, but not the standalone way. Camunda 7.6 runs into a JBoss-EAP 7(Same WildFly Distribution) and I think the modules are on the right places. But the following code throws an error message.

DmnEngine dmnEngine = DmnEngineConfiguration.createDefaultDmnEngineConfiguration().buildEng

DecisionService is not enough for me because I want to read the inputs from DecisionLogic .

Caused by: java.lang.NoClassDefFoundError: javax/el/ELContext
    at org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration.initElProvider(DefaultDmnEngineConfiguration.java:128)
    at org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration.init(DefaultDmnEngineConfiguration.java:78)
    at org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration.buildEngine(DefaultDmnEngineConfiguration.java:69)
    at // DmnEngineConfiguration.createDefaultDmnEngineConfiguration().buildEngine();
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
    at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)
    at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:82)
    at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:93)
    at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
    at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43)
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
    at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
    at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)
    at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:64)
    at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83)
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
    at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45)
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
    at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
    at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
    at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:52)
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
    at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51)
    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
    at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:254)
    ... 324 more
Caused by: java.lang.ClassNotFoundException: javax.el.ELContext from [Module "org.camunda.bpm.dmn.camunda-engine-dmn:main" from local module loader @66133adc (finder: local module finder @7bfcd12c (roots: [JBOSS_HOME]\modules, [JBOSS_HOME]\modules\system\layers\base))]
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351)
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93)
    ... 357 more

The modul org.camunda.bpm.dmn.camunda-engine-dmn:main is there

Maven Dependencies

<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.dmn</groupId>
        <artifactId>camunda-engine-dmn</artifactId>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.camunda.bpm.javaee</groupId>
        <artifactId>camunda-ejb-client</artifactId>
    </dependency>
    <dependency>
        <groupId>org.camunda.bpm</groupId>
        <artifactId>camunda-engine-cdi</artifactId>
    </dependency>
    ...
<dependencies>

The module org.camunda.bpm.dmn.camunda-engine-dmn:main cannot find the class javax.el.ELContext,
You can fix this editing the file
$JBOSS_HOME\modules\org\camunda\bpm\dmn\camunda-engine-dmn\main\module.xml
and adding
<module name="javax.el.api"/>
as another dependency.
Restart JBoss EAP / Wildfly afterwards.

1 Like

Hello all,
I know this issue is already old, but i keep running into the exact same problem with the provided current Wildfly-26.0.1-Camunda-7-18.0 stack.

I have added the module “javax.el.api” as described in the Post above, but after the restart I get the following error:

java.lang.NoClassDefFoundError: de/odysseus/el/util/SimpleContext at [org.camunda.bpm.dmn.camunda-engine-dmn@7.18.0//org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration.initElProvider](mailto:org.camunda.bpm.dmn.camunda-engine-dmn@7.18.0//org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration.initElProvider)(DefaultDmnEngineConfiguration.java:178) at [org.camunda.bpm.dmn.camunda-engine-dmn@7.18.0//org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration.init](mailto:org.camunda.bpm.dmn.camunda-engine-dmn@7.18.0//org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration.init)(DefaultDmnEngineConfiguration.java:96) at [org.camunda.bpm.dmn.camunda-engine-dmn@7.18.0//org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration.buildEngine](mailto:org.camunda.bpm.dmn.camunda-engine-dmn@7.18.0//org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration.buildEngine)(DefaultDmnEngineConfiguration.java:86)

I found out, that the mentioned class “de/odysseus/el/util/SimpleContext” is contained in the juel-impl-2.2.7.jar, but when I add this one also as a Jboss-module (via jboss_cli) and add the module also to the module.xml of the camunda-engine-dmn, then I get even stranger errors which I can provide if needed.

For me it seems unclear, if the programmatic initialization of the DmnEngineConfiguration is conceptually really meant to work also inside a Jboss or only inside standalone applications. I would have preferred to get my following initialization code running also inside Jboss, but I suspect, that I am meant to deploy the DMN-Files and run the decision evaluation via REST-API.

        dmnEngineConfiguration = DmnEngineConfiguration.createDefaultDmnEngineConfiguration();
        dmnEngine = dmnEngineConfiguration.buildEngine();
        InputStream inputStream = resourceFileReader.getFileFromResourceAsInputStream(DMN_FILE_NAME);
        DmnModelInstance dmnModelInstance = Dmn.readModelFromStream(inputStream);
        dmnDecision = dmnEngine.parseDecision(DMN_DECISION_KEY, dmnModelInstance);

Is there anyone who can clarify this?

Many thanks in advance,
Stephan

I cannot reproduce your problem.

Class de.odysseus.el.util.SimpleContext
is in org/camunda/bpm/dmn/camunda-engine-feel-juel/main/camunda-engine-feel-juel-<Camunda Version>.jar
as **camundafeel/**de/odysseus/el/util/SimpleContext.class
and module org.camunda.bpm.dmn.camunda-engine-dmn has a dependency on org.camunda.bpm.dmn.camunda-engine-feel-juel.

Your error with line breaks is

java.lang.NoClassDefFoundError: de/odysseus/el/util/SimpleContext
 at [org.camunda.bpm.dmn.camunda-engine-dmn@7.18.0//org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration.initElProvider](mailto:org.camunda.bpm.dmn.camunda-engine-dmn@7.18.0//org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration.initElProvider)(DefaultDmnEngineConfiguration.java:178) 
 at [org.camunda.bpm.dmn.camunda-engine-dmn@7.18.0//org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration.init](mailto:org.camunda.bpm.dmn.camunda-engine-dmn@7.18.0//org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration.init)(DefaultDmnEngineConfiguration.java:96) 
 at [org.camunda.bpm.dmn.camunda-engine-dmn@7.18.0//org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration.buildEngine](mailto:org.camunda.bpm.dmn.camunda-engine-dmn@7.18.0//org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration.buildEngine)(DefaultDmnEngineConfiguration.java:86)

I tried this without any problems:

  DmnEngineConfiguration dmnEngineConfiguration = DmnEngineConfiguration.createDefaultDmnEngineConfiguration();
  DmnEngine dmnEngine = dmnEngineConfiguration.buildEngine();
  DmnModelInstance dmnModelInstance = Dmn.readModelFromFile( new File( "/mbi/mbi2e_all/bpm/sus_Retoure_CandidateUser.dmn" ) );
  List<DmnDecision> decisions = dmnEngine.parseDecisions( dmnModelInstance );
  for ( DmnDecision decision : decisions ) {
    CamundaInterface.LOGGER.debug( decision );
   }

Which Java Version you’re using ? I’m still on Java 8. Can you try with Java 8 ?
Also using Wildfly 26.0.1 but with Camunda 7.19.0-SNAPSHOT, but this should not make a difference.

Thank you for your efforts!
I saw already that SimpleContext also exists in camunda-engine-feel-juel, but as you mentioned, it is in a different package. So that one didn’t seem to be a way out, because the ClassNotFound goes explicitly for “de.odysseus.el.util.SimpleContext”. That’s why I finally suspected that this kind of init code is not meant to run inside jboss because something is screwn up there with the dependencies.

I could try with Java 8, but that would just be for theory because my task includes a migration from Java 8 to Java 11 and so this code will definitely have to run with java 11 anyway.

Thanks again,
Stephan

Stephan,
perhaps this old thread is helpful for you to solve your problem:
https://groups.google.com/g/camunda-bpm-users/c/Z2bKes3nIA0

Hi Frank,
i tried the solution from your link and added these 3 dependencies so that they are included in WEB-INF/lib of my webapp, but the same error persists.
I also tried the approach to add the 3 deps either to jboss-deployment-structure.xml or to the “Dependencies:” key of the MANIFEST.MF but always the same error.
I also verified that my changes got deployed to wildfly correctly by looking into the war file under standalone/deployments to make sure that the desired change has really been incorporated into the artifact.
Any other ideas? Otherwise I will give up on this and we will go with the Shared Engine approach - which works but which is of course slower because every evaluation of a decisiontable gets written to the database. My client does a) not see the need for this persistence mechanism and b) prefers the better performance without persistence. Is there at least a way to disable the persistence of the evaluation?

Many thanks again,
Stephan