While using KIE-CI to fire rules deployed in a remote BRMS server the standalone code throws the exception Cannot find KieModule
Issue
- As per the following Community documentation [1] ,
KieModule
which is a Maven produced JAR (containing the required rule assets) with akmodule.xml
in it can be loaded from theclasspath
or dynamically at runtime from aResource
location. While using a standalone Java SE application to fire the rules (packaged inside theKieModule
Jar as mentioned earlier) works fine if the Jar containing rules is picked up fromclasspath
using the following API call.
KieServices kieServices = KieServices.Factory.get();
KieContainer kieContainer = kieServices.getKieClasspathContainer();
...
But, if the approach is changed to use the KieScanner
[2] so that the rule assets could be accessed from the Jar residing in remote BRMS server, it gives the following exception.
Exception in thread "main" java.lang.RuntimeException: Cannot find KieModule: org.kie.test.sampleApp:remoteProject:2.0.0
...
Code using KIE-CI
.
KieServices kieServices = KieServices.Factory.get();
ReleaseId releaseID = kieServices.newReleaseId("org.kie.test.sampleApp", "remoteProject","2.0.0");
KieContainer kieContainer = kieServices.newKieContainer(releaseID);
KieScanner kieScanner = kieServices.newKieScanner(kieContainer);
kieScanner.start(100L);
...
How to fix this issue?
[1] http://docs.jboss.org/drools/release/6.0.0.Final/drools-docs/html/DroolsReleaseNotesChapter.html#d0e496
[2] http://docs.jboss.org/drools/release/6.0.0.Final/drools-docs/html/DroolsReleaseNotesChapter.html#d0e515
Environment
- Red Hat JBoss BRMS (BRMS)
- 6.0.0 Beta
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.