Ram
Ram

Reputation: 35

"java.lang.RuntimeException: Cannot find KieModule" in setup Drool with Tomcat

We have set up and deployed Drool 7.15 application with Tomcat 8.0. However, the problem is when we try to deploy the rules we are getting the below exception. java.lang.RuntimeException: Cannot find KieModule: com.tisl.mpl.ruleengine:rrt-kjar:1.0.0

What could the the Fix for this? This same jar was working fine in Wildfly(jBOSS)

14-Sep-2019 18:24:06.510 SEVERE [http-nio-8080-exec-8] org.kie.server.services.impl.KieServerImpl.createContainer Error creating container 'RRTRULE' for module 'com.tisl.mpl.ruleengine:rrt-kjar:1.0.0' java.lang.RuntimeException: Cannot find KieModule: com.tisl.mpl.ruleengine:rrt-kjar:1.0.0 at org.drools.compiler.kie.builder.impl.KieServicesImpl.newKieContainer(KieServicesImpl.java:117) at org.drools.compiler.kie.builder.impl.KieServicesImpl.newKieContainer(KieServicesImpl.java:111) at org.kie.server.services.impl.KieServerImpl.createContainer(KieServerImpl.java:214) at org.kie.server.remote.rest.common.resource.KieServerRestImpl.createContainer(KieServerRestImpl.java:90) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:168) at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:269) at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:227) at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:216) at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:541) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:523) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:125) at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.kie.server.services.impl.security.web.CaptureHttpRequestFilter.doFilter(CaptureHttpRequestFilter.java:42) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:645) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678) at

org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:798) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:810) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748)

-Ram

Upvotes: 1

Views: 7875

Answers (5)

Salim
Salim

Reputation: 2178

I had similar issue because the folder ~/.m2/ didn't have sufficient permission for the boss user to read the saved repositories. Making this folder owned by jboss user solved the issue.

Upvotes: 0

Most important thing is that both of kie-server and the Wildfly(business-central) should access the same repository that the KieModule is deployed on it. If they are running in different machines you could create a remote repository or If they are being run by different users on the same machine then you should create a settings.xml file in the '.m2' directory of the kie-server service owner.

You should define requirement local and remote repositories in the settings.xml file.

Upvotes: 0

Delirante
Delirante

Reputation: 919

It happend to me when kjar module, in this case 'com.tisl.mpl.ruleengine:rrt-kjar:1.0.0', was not inside /opt/jboss/.m2/repository folder. So make sure that you have tree structure like this: /opt/jboss/.m2/repository/com/tisl/mpl/ruleengine/rrt-kjar/1.0.0/

And inside this folder you should have two files: rrt-kjar-1.0.0.jar and rrt-kjar-1.0.0.pom

Upvotes: 0

X-Pippes
X-Pippes

Reputation: 1170

another issue could be the server do not have permissions/enough disk space to perform the mvn install and the create the kjar on the local maven repository. i've seen a pipeline doing the deploy/container, and failed with the reported issue. we do not see any error on logs and/or pipeline stack. please check if the local repository has that kjar maven artifact

Upvotes: 0

Anton Giertli
Anton Giertli

Reputation: 936

There are multiple possible explanations of the error you are facing.

1) Missing kie-ci library on the classpath - To solve this, you need to declare it as a maven dependency (or bundle it in any other way with your app)

2) You made a typo in ReleaseId and the KJAR with following GAV indeed does not exist: com.tisl.mpl.ruleengine:rrt-kjar:1.0.0

3) The KJAR does exist, but you have misconfigured your settings.xml - i.e. it is missing the configuration of the remote repository (or proxy, etc..) where that KJAR is is uploaded

4) Your settings.xml are properly configured but they are not stored in the default location which is ~/.m2/settings.xml. If that's the case you need to set system property kie.maven.settings.custom and configure it to to the location of the settings.xml. i.e. ./start.sh -Dkie.maven.settings.custom=/opt/kie/settings.xml

I have worked 6 years as a support engineer for Drools, it was always one of the above.

Upvotes: 8

Related Questions