Cannot Start Camunda from Spring Boot

Hi there,
I’m trying to start a Camunda Server from Spring Boot (via this example GitHub - berndruecker/camunda-spring-boot-amqp-microservice-cloud-example: Simple example using Camunda and Spring Boot to define a simple microservice communcating via AMQP, fully unit tested and deployable in the cloud)
But when I start the application, it’s always throws the exception below and stopped immediately.
I attached my pom file.
Is there any advise! Many thanks!

The logs:


/ | __ _ _ __ ___ _ _ _ __ | | __ _ | __ )| _ | / |
| | / | '_ _ | | | | ’ \ / |/ _ | | _ | |) | |/| |
| |
| (
| | | | | | | |
| | | | | (
| | (| | | |) | /| | | |
_
/_,|| || ||_,|| ||_,|_,| |_/|| || ||

Spring-Boot: (v2.1.0.RELEASE)
Camunda BPM: (v7.12.0)
Camunda BPM Spring Boot Starter: (v3.2.1)

2020-03-24 08:01:35.373 INFO 64648 — [ main] vn.mbf.bigdata.FinApiMainApplication : Starting FinApiMainApplication on TTCNTT_HAIND with PID 64648 (E:\Git\QLDVFintech\fin-api\target\classes started by hai.nguyenduc in E:\Git\QLDVFintech\fin-api)
2020-03-24 08:01:35.391 INFO 64648 — [ main] vn.mbf.bigdata.FinApiMainApplication : No active profile set, falling back to default profiles: default
2020-03-24 08:01:36.544 ERROR 64648 — [ main] o.s.boot.SpringApplication : Application run failed

java.lang.IllegalStateException: Error processing condition on org.springframework.boot.autoconfigure.jersey.JerseyAutoConfiguration
at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:64)
at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:108)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader$TrackedConditionEvaluator.shouldSkip(ConfigurationClassBeanDefinitionReader.java:447)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader$TrackedConditionEvaluator.shouldSkip(ConfigurationClassBeanDefinitionReader.java:436)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:128)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:117)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:327)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:232)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:275)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:95)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:691)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:528)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)
at vn.mbf.bigdata.FinApiMainApplication.main(FinApiMainApplication.java:43)
Caused by: java.lang.IllegalStateException: Failed to introspect Class [org.camunda.bpm.spring.boot.starter.rest.CamundaBpmRestJerseyAutoConfiguration] from ClassLoader [sun.misc.Launcher$AppClassLoader@2a139a55]
at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:680)
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:577)
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:562)
at org.springframework.util.ReflectionUtils.getUniqueDeclaredMethods(ReflectionUtils.java:620)
at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(Unknown Source)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:721)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:662)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:630)
at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1491)
at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1014)
at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry.addBeanTypeForNonAliasDefinition(BeanTypeRegistry.java:195)
at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry.addBeanTypeForNonAliasDefinition(BeanTypeRegistry.java:159)
at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry.addBeanType(BeanTypeRegistry.java:152)
at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry.updateTypesIfNecessary(BeanTypeRegistry.java:140)
at java.util.Iterator.forEachRemaining(Unknown Source)
at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry.updateTypesIfNecessary(BeanTypeRegistry.java:135)
at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry.getNamesForType(BeanTypeRegistry.java:97)
at org.springframework.boot.autoconfigure.condition.OnBeanCondition.collectBeanNamesForType(OnBeanCondition.java:298)
at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getBeanNamesForType(OnBeanCondition.java:289)
at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getBeanNamesForType(OnBeanCondition.java:278)
at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchingBeans(OnBeanCondition.java:189)
at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchOutcome(OnBeanCondition.java:125)
at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:47)
… 18 common frames omitted
Caused by: java.lang.NoClassDefFoundError: org/camunda/bpm/engine/rest/impl/FetchAndLockContextListener
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.getDeclaredMethods(Unknown Source)
at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:662)
… 40 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.camunda.bpm.engine.rest.impl.FetchAndLockContextListener
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
… 44 common frames omitted

2020-03-24 08:01:36.548 WARN 64648 — [ main] o.s.boot.SpringApplication : Unable to close ApplicationContext

java.lang.IllegalStateException: Failed to introspect Class [org.camunda.bpm.spring.boot.starter.rest.CamundaBpmRestJerseyAutoConfiguration] from ClassLoader [sun.misc.Launcher$AppClassLoader@2a139a55]
at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:680)
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:577)
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:562)
at org.springframework.util.ReflectionUtils.getUniqueDeclaredMethods(ReflectionUtils.java:620)
at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(Unknown Source)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:721)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:662)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:630)
at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1491)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:507)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:477)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:598)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:590)
at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:1204)
at org.springframework.boot.SpringApplication.getExitCodeFromMappedException(SpringApplication.java:905)
at org.springframework.boot.SpringApplication.getExitCodeFromException(SpringApplication.java:891)
at org.springframework.boot.SpringApplication.handleExitCode(SpringApplication.java:877)
at org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:826)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:327)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)
at vn.mbf.bigdata.FinApiMainApplication.main(FinApiMainApplication.java:43)
Caused by: java.lang.NoClassDefFoundError: org/camunda/bpm/engine/rest/impl/FetchAndLockContextListener
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.getDeclaredMethods(Unknown Source)
at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:662)
… 21 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.camunda.bpm.engine.rest.impl.FetchAndLockContextListener
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
… 25 common frames omitted

pom.xml (8.9 KB) pom.xml (8.9 KB)

Hey hai.nd46!

Could you share a small project where we can reproduce the issue? Best something self-contained (e.g. also without Oracle)?

That would help to look into it.
Best
Bernd

Hi Bernd,
Thank for your reply.
The project I downloaded from the link i’ve shared:

GitHub - berndruecker/camunda-7-springboot-amqp-microservice-cloud-example: Simple example using Camunda and Spring Boot to define a simple microservice communcating via AMQP, fully unit tested and deployable in the cloud

Oh. may be my libs are downloaded failed.
I try to remove all the libs from C:\Users\user_name.m2\repository\org\camunda\bpm and then re-save the pom.xml file.
And it’s worked!