'Error creating bean with name 'kieServer' while running kie-server-spring-boot-sample
I am trying to start a springboot application residing here https://github.com/kiegroup/droolsjbpm-integration/tree/main/kie-spring-boot/kie-spring-boot-samples/kie-server-spring-boot-sample. I cloned the repo and did maven clean install.Later when Im starting the app Im seeing below.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'kieServer' defined in class path resource [org/kie/server/springboot/autoconfiguration/KieServerAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.kie.server.services.api.KieServer]: Factory method 'kieServer' threw exception; nested exception is java.lang.NoClassDefFoundError: org/junit/runner/Runner
Why is the application classloader looking for a junit class is what I am not able wrap my head around. I tried adding junit dependencies explicitly to my pom that doesn't work.
Any help is appreciated,thanks in advance.
Solution 1:[1]
Firstly, it is never recommended to add class files in this manner, but it does not stop from doing so
compileJava.classpath = compileJava.classpath + files(file("$project.rootDir/lib"))
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | PrasadU |
