Starting an embedded process engine. ClassNotFoundException: org.camunda.bpm.application.ProcessApplicationInterface

Hi, I have worked with camunda the last couple day.
For now I have developed my application in eclipse, made a war file, put it into the deployments folder of the camunda WildFly Distribution server and started the start-camunda.bat.
Everything worked fine.

But now I want to start a project directly from Eclipse with a embedded process engine.

I have tried many things, but still getting the same error message.
I followed the steps on https://github.com/camunda/camunda-consulting/tree/master/snippets/embedded-engine-without-spring
but still doesnt work.


That’s my error message when I start it in Eclipse on a WildFly 10:

17:50:15,451 WARN [org.jboss.as.connector] (MSC service thread 1-2) WFLYJCA0091: -ds.xml file deployments are deprecated. Support may be removed in a future version.
17:50:15,552 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-3) WFLYJCA0001: Bound data source [java:jboss/datasources/ePaPDS]
17:50:15,554 INFO [org.jboss.as.jpa] (ServerService Thread Pool – 59) WFLYJPA0010: Starting Persistence Unit (phase 1 of 2) Service ‘ePaP.war#primary’
17:50:15,565 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC000001: Failed to start service jboss.deployment.unit.“ePaP.war”.POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit.“ePaP.war”.POST_MODULE: WFLYSRV0153: Failed to process phase POST_MODULE of deployment “ePaP.war”
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:154)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.RuntimeException: WFLYSRV0177: Error getting reflective information for class org.camunda.bpm.application.impl.web.ProcessArchiveServletContextListener with ClassLoader ModuleClassLoader for Module “deployment.ePaP.war:main” from Service Module Loader
at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:70)
at org.jboss.as.ee.metadata.MethodAnnotationAggregator.runtimeAnnotationInformation(MethodAnnotationAggregator.java:57)
at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.handleAnnotations(InterceptorAnnotationProcessor.java:106)
at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:91)
at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:76)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:147)
… 5 more
Caused by: java.lang.NoClassDefFoundError: Lorg/camunda/bpm/application/ProcessApplicationInterface;
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Unknown Source)
at java.lang.Class.getDeclaredFields(Unknown Source)
at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.(ClassReflectionIndex.java:72)
at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:66)
… 10 more
Caused by: java.lang.ClassNotFoundException: org.camunda.bpm.application.ProcessApplicationInterface from [Module “deployment.ePaP.war:main” from Service Module Loader]
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)
… 15 more

17:50:15,586 INFO [org.hibernate.jpa.internal.util.LogHelper] (ServerService Thread Pool – 59) HHH000204: Processing PersistenceUnitInfo [
name: primary
…]
17:50:15,670 INFO [org.hibernate.Version] (ServerService Thread Pool – 59) HHH000412: Hibernate Core {5.0.9.Final}
17:50:15,672 INFO [org.hibernate.cfg.Environment] (ServerService Thread Pool – 59) HHH000206: hibernate.properties not found
17:50:15,674 INFO [org.hibernate.cfg.Environment] (ServerService Thread Pool – 59) HHH000021: Bytecode provider name : javassist
17:50:15,720 INFO [org.hibernate.annotations.common.Version] (ServerService Thread Pool – 59) HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
17:50:15,771 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation (“deploy”) failed - address: ([(“deployment” => “ePaP.war”)]) - failure description: {
“WFLYCTL0080: Failed services” => {“jboss.deployment.unit.“ePaP.war”.POST_MODULE” => “org.jboss.msc.service.StartException in service jboss.deployment.unit.“ePaP.war”.POST_MODULE: WFLYSRV0153: Failed to process phase POST_MODULE of deployment “ePaP.war”
Caused by: java.lang.RuntimeException: WFLYSRV0177: Error getting reflective information for class org.camunda.bpm.application.impl.web.ProcessArchiveServletContextListener with ClassLoader ModuleClassLoader for Module “deployment.ePaP.war:main” from Service Module Loader
Caused by: java.lang.NoClassDefFoundError: Lorg/camunda/bpm/application/ProcessApplicationInterface;
Caused by: java.lang.ClassNotFoundException: org.camunda.bpm.application.ProcessApplicationInterface from [Module “deployment.ePaP.war:main” from Service Module Loader]”},
“WFLYCTL0412: Required services that are not installed:” => [“jboss.deployment.unit.“ePaP.war”.POST_MODULE”],
“WFLYCTL0180: Services with missing/unavailable dependencies” => undefined
}


I used used the processes.xml and dependencies, which are descriped on this site:
https://github.com/camunda/camunda-consulting/tree/master/snippets/embedded-engine-without-spring

Another question.
If I have an embedded process engine, can I @Inject it from everywhere in my application?

I solved this error, it was a really stupid fail of myself.
Because I always used the provided process engine, i still had the dependency scope of the process-engine ‘provided’…

Thanks for sharing the solution.