ClassNotFoundException: org.camunda.bpm.engine.impl.util.SingleConsumerCondition


#1

Hello, I am new here…

I am trying to add REST interface to existing and working application so that I I don’t need to send Cookie with JSessionID into internal rest engine,
I have added dependency to camunda-bpm-spring-boot-starter-rest, but then application refuses to start due to following exception:

java.util.ServiceConfigurationError: org.camunda.bpm.engine.rest.spi.FetchAndLockHandler: Provider org.camunda.bpm.engine.rest.impl.FetchAndLockHandlerImpl could not be instantiated
at java.util.ServiceLoader.fail(ServiceLoader.java:232)
at java.util.ServiceLoader.access$100(ServiceLoader.java:185)
at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:384)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
at org.camunda.bpm.engine.rest.impl.FetchAndLockContextListener.lookupFetchAndLockHandler(FetchAndLockContextListener.java:55)
at org.camunda.bpm.engine.rest.impl.FetchAndLockContextListener.contextInitialized(FetchAndLockContextListener.java:37)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4790)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5256)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1421)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1411)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NoClassDefFoundError: org/camunda/bpm/engine/impl/util/SingleConsumerCondition
at org.camunda.bpm.engine.rest.impl.FetchAndLockHandlerImpl.(FetchAndLockHandlerImpl.java:65)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:380)
… 13 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.camunda.bpm.engine.impl.util.SingleConsumerCondition
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
… 20 common frames omitted

I was able to find out that missing class is in camunda-bpm-platform.jar, but I have no clue which Maven artifact contains it. Could you help me find out which dependencies I am missing, please?

Thank you,
Pavel


#2

pom-snippet.txt (1.2 KB)


#3

I was able to resolve this issue.

It was caused by incorrect version of camunda-bpm-spring-boot-starter-rest, mismatching other library versions. When I changed it from 3.2.1 to 3.0.0 it started to work.