Errors while deploying starter Spring-Boot

Hi All,

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

Also, I am continuously getting this error :

`Whitelabel Error Page

This application has no explicit mapping for /error, so you are seeing this as a fallback.

Fri Sep 20 10:51:37 IST 2019

There was an unexpected error (type=Not Found, status=404).

No message available`

Could you please share your pom.xml and which url do you try to access?

conditions_report.txt (99.9 KB)

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

I am running it on Gradle.

Some JARs are :

camunda-engine-rest-core-7.12.0-alpha3
camunda-bpm-spring-boot-starter-rest-2.0.0
java-uuid-generator-3.1.3
camunda-bpmn-model-7.10.0
camunda-bpm-spring-boot-starter-3.2.0
camunda-external-task-client-1.2.2

Attached are my dependencies

gradle_deps.txt (2.3 KB)

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
  • spring-boot: 2.1.x
  • camunda-external-task-client: 1.2.2

(1): https://docs.camunda.org/manual/7.11/user-guide/spring-boot-integration/version-compatibility/
(2): https://docs.camunda.org/manual/7.11/user-guide/ext-client/compatibility-matrix/

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?

for example here:
https://search.maven.org/search?q=g:org.camunda.bpm

I am getting this error now :

And I don’t see a JAR to be downloaded for this.


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

Are you using maven or Gradle? You can do maven or Gradle refresh dependencies, which will pull the jars if not available in the classpath

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?

image

And below is my spring config JARs :

image

after importing jaxrs2 JAR the above issue was resolved but for the URL, I am still getting 404 Not Found.

The URL at my side which are down are :
http://localhost:9081/engine-rest/task
http://localhost:9081/rest/task

However the actuator URL is up and running for me - http://localhost:9081/actuator/health

Also I am getting below error :

2019-09-21 22:36:29.545 WARN 2584 — [on(6)-127.0.0.1] o.s.b.actuate.ldap.LdapHealthIndicator : LDAP health check failed

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]

@Yana, @Niall, @aravindhrs - Can you please help me with this?

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

    test[version: 1, id: test:1:3c20625b-ddcd-11e9-9ec2-a0481c8044df]

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

Hello, @Anuj28282828.

Try this URL http://localhost:9081/rest/engine/

@Beagler - For your consideration

For spring apps the base URL for rest is http://localhost:8080/rest.

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)

Have a look at the rest dependency

<dependency>
      <groupId>org.camunda.bpm.springboot</groupId>
      <artifactId>camunda-bpm-spring-boot-starter-rest</artifactId>
      <version>${camundaSpringBoot.version}</version>
</dependency>