I am getting this error while deploying a simple Spring-Boot camunda-spring-boot-starter-rest project.
Any ideas?
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘createRestConfig’ defined in class path resource [org/camunda/bpm/spring/boot/starter/rest/CamundaBpmRestJerseyAutoConfiguration.class]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/camunda/bpm/engine/rest/impl/CamundaRestResources
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1702) ~[spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:579) ~[spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:501) ~[spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317) ~[spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) ~[spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315) ~[spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:760) ~[spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:869) ~[spring-context-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) ~[spring-context-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) ~[spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:762) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:398) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:330) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1258) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1246) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE]
at com.camunda.demo.config.MainConfig.main(MainConfig.java:21) [classes/:na]
Caused by: java.lang.NoClassDefFoundError: org/camunda/bpm/engine/rest/impl/CamundaRestResources
at org.camunda.bpm.spring.boot.starter.rest.CamundaJerseyResourceConfig.registerCamundaRestResources(CamundaJerseyResourceConfig.java:25) ~[camunda-bpm-spring-boot-starter-rest-2.0.0.jar:2.0.0]
at org.camunda.bpm.spring.boot.starter.rest.CamundaJerseyResourceConfig.afterPropertiesSet(CamundaJerseyResourceConfig.java:18) ~[camunda-bpm-spring-boot-starter-rest-2.0.0.jar:2.0.0]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1761) ~[spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1698) ~[spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE]
… 16 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.camunda.bpm.engine.rest.impl.CamundaRestResources
at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_162]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_162]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338) ~[na:1.8.0_162]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_162]
… 20 common frames omitted
Here are some positive/negative matches from CONDITIONS EVALUATION REPORT in DEBUG mode.
My application is up and running fine but I am not able to hit the rest calls
you have inconsistent versions for the engine, starter, model, and client,
pick the engine version
for example 7.11.0 and then follow the Version Compatibility matrixes (1), (2) to choose the other versions:
camunda-bpmn-model and camunda-engine-rest-core should match as well: 7.11.0
camunda-bpm-spring-boot-starter-rest and camunda-bpm-spring-boot-starter should match: 3.2.0
Where do I get to know what are the versions available for camunda-engine-rest-core/camunda-bpmn-model/camunda-bpm-spring-boot-starter-rest/camunda-bpm-spring-boot-starter?
java.lang.IllegalStateException: Failed to introspect Class [org.camunda.bpm.spring.boot.starter.rest.CamundaBpmRestJerseyAutoConfiguration] from ClassLoader [sun.misc.Launcher$AppClassLoader@18b4aac2]
at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:686) ~[spring-core-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:583) ~[spring-core-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:568) ~[spring-core-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.util.ReflectionUtils.getUniqueDeclaredMethods(ReflectionUtils.java:626) ~[spring-core-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1688) ~[na:1.8.0_162]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:721) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:662) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:630) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1518) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:507) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:477) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:598) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:590) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:1204) ~[spring-context-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.boot.SpringApplication.getExitCodeFromMappedException(SpringApplication.java:905) [spring-boot-2.1.1.RELEASE.jar:2.1.1.RELEASE]
at org.springframework.boot.SpringApplication.getExitCodeFromException(SpringApplication.java:891) [spring-boot-2.1.1.RELEASE.jar:2.1.1.RELEASE]
at org.springframework.boot.SpringApplication.handleExitCode(SpringApplication.java:877) [spring-boot-2.1.1.RELEASE.jar:2.1.1.RELEASE]
at org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:826) [spring-boot-2.1.1.RELEASE.jar:2.1.1.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:327) [spring-boot-2.1.1.RELEASE.jar:2.1.1.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260) [spring-boot-2.1.1.RELEASE.jar:2.1.1.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248) [spring-boot-2.1.1.RELEASE.jar:2.1.1.RELEASE]
at com.camunda.demo.config.MainConfig.main(MainConfig.java:20) [classes/:na]
Caused by: java.lang.NoClassDefFoundError: org/camunda/bpm/engine/rest/impl/FetchAndLockContextListener
at java.lang.Class.getDeclaredMethods0(Native Method) ~[na:1.8.0_162]
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) ~[na:1.8.0_162]
at java.lang.Class.getDeclaredMethods(Class.java:1975) ~[na:1.8.0_162]
at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:668) ~[spring-core-5.1.3.RELEASE.jar:5.1.3.RELEASE]
… 21 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.camunda.bpm.engine.rest.impl.FetchAndLockContextListener
at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_162]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_162]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338) ~[na:1.8.0_162]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_162]
… 25 common frames omitted
Hey Aravindh/Yana - This class comes from a WAR file. Why is this really required for setting up a simple Spring Boot application? How can you import a war file?
Also, this is how my gradle dependencies look like right now :
Do you see any issues here now?
java.lang.NullPointerException: null
at java.util.Hashtable.put(Hashtable.java:460) ~[na:1.8.0_162]
at org.springframework.ldap.core.support.SimpleDirContextAuthenticationStrategy.setupEnvironment(SimpleDirContextAuthenticationStrategy.java:43) ~[spring-ldap-1.3.0.RELEASE.jar:1.3.0.RELEASE]
at org.springframework.ldap.core.support.AbstractContextSource.setupAuthenticatedEnvironment(AbstractContextSource.java:155) ~[spring-ldap-1.3.0.RELEASE.jar:1.3.0.RELEASE]
at org.springframework.ldap.core.support.AbstractContextSource.getAuthenticatedEnv(AbstractContextSource.java:481) ~[spring-ldap-1.3.0.RELEASE.jar:1.3.0.RELEASE]
Even after below success message in logs, the engine-rest API still says 404 not found.
Some log snippet :
2019-09-23 12:11:55.524 INFO 14072 — [ main] org.camunda.bpm.container : ENGINE-08023 Deployment summary for process archive ‘mainConfig’:
test.bpmn
2019-09-23 12:11:55.834 INFO 14072 — [ main] org.camunda.bpm.application : ENGINE-07021 ProcessApplication ‘mainConfig’ registered for DB deployments [3bf3fb29-ddcd-11e9-9ec2-a0481c8044df]. Will execute process definitions
Deployment does not provide any case definitions.
2019-09-23 12:11:55.888 INFO 14072 — [ main] org.camunda.bpm.container : ENGINE-08050 Process application mainConfig successfully deployed
Here is a sample pom.xml that is generated from the archetype. Camunda provides Maven archetypes to help prevent errors in version mismatchespom.xml (5.5 KB)