after I upgrade JDK to 17, I am getting
required a bean of type ‘org.camunda.bpm.engine.RuntimeService’ that could not be found
Here is dependency I am using
org.camunda.bpm.springboot
camunda-bpm-spring-boot-starter
7.17.0
Any idea how to resolve this
Appreciate any help on this topic.
Hello guy!
This happens because for some reason Spring cannot find the bean.
- First, did you adjust the POM XML for JDK version 17?
<properties>
<java.version>17</java.version>
</properties>
-
Is your JDK as a JAVA_HOME environment variable?
-
After making sure this, run maven again to load the dependencies, using the commands below in your terminal:
mvn clean
mvn install
If this still doesn’t work, try manually adding a RuntimeService bean.
For this, create a class containing a public function in your java project to return a RuntimeService and place @bean as an annotation.
@Bean
public RuntimeService runtimeService(ProcessEngine processEngine) {
return processEngine.getRuntimeService();
}
I hope I’ve helped you.
Big hug!
Att.
William Robert Alves
Hi,
After creating the above bean, I get an error :-
Parameter 0 of method runtimeService in org.onap.so.TestApplication required a bean of type ‘org.camunda.bpm.engine.ProcessEngine’ that could not be found.
Action:
Consider defining a bean of type ‘org.camunda.bpm.engine.ProcessEngine’ in your configuration.
Change camunda version to 7.20
This didn’t help (((
Camunda 7.20.0
spring 3.1.2
Hello guys!
Try adding the @EnableProcessApplication
annotation to your application’s main class and/or your test class.
This causes Camunda to be configured in the context of your Spring application.
William Robert Alves
Simply remove @Autowired annotation, it will work.