Deploying an exploded EAR in Websphere AS 8.5.x with Kie Jar packaged inside it throws Unable to build index of kmodule.xml exception
Issue
- The scenario looks something like this. There is a
WARwhich looks up for rule assets throughKie-classpathAPI from it's classpath where the rule assets are built and packaged into aKie Jar(e.g.ModuleJar-1.0.0.jar) is lying inside<WAR>/WEB-INF/libdirectory along with otherDrools 6related jars. TheKie Jarare built and fetched from a separateRed Hat JBoss BRMS 6.0.0installation. Now, the entireWARis packaged inside an explodedEARand then deployed into Websphere AS 8.5.x . This causes the following exception to occur in server's console.
[2/20/14 10:15:25:180 IST] 0000005f SystemOut O INFO : org.drools.compiler.kie.builder.impl.ClasspathKieProject - Found kmodule: wsjar:file:/.../TestEAR.ear/TestWAR.war/WEB-INF/lib/ModuleJar-1.0.0.jar!/META-INF/kmodule.xml
[2/20/14 10:15:25:181 IST] 0000005f SystemOut O WARN : org.drools.compiler.kie.builder.impl.ClasspathKieProject - Unable to load pom.properties tried recursing down from/.../TestEAR.ear/TestWAR.war/WEB-INF/lib/ModuleJar-1.0.0.jar!
null
[2/20/14 10:15:25:182 IST] 0000005f SystemOut O ERROR: org.drools.compiler.kie.builder.impl.ClasspathKieProject - Unable to build index of kmodule.xml url=wsjar:file:/.../TestEAR.ear/TestWAR.war/WEB-INF/lib/ModuleJar-1.0.0.jar!/META-INF/kmodule.xml
null
[2/20/14 10:15:25:182 IST] 0000005f SystemOut O INFO : org.drools.compiler.kie.builder.impl.ClasspathKieProject - Found kmodule: wsjar:file:/.../TestEAR.ear/TestWAR.war/WEB-INF/lib/ModuleJar-1.0.0.jar!/META-INF/kmodule.xml
[2/20/14 10:15:25:183 PST] 0000005f SystemOut O WARN : org.drools.compiler.kie.builder.impl.ClasspathKieProject - Unable to load pom.properties tried recursing down from/.../TestEAR.ear/TestWAR.war/WEB-INF/lib/ModuleJar-1.0.0.jar!
null
[2/20/14 10:15:25:183 IST] 0000005f SystemOut O ERROR: org.drools.compiler.kie.builder.impl.ClasspathKieProject - Unable to build index of kmodule.xml url=wsjar:file:/.../TestEAR.ear/TestWAR.war/WEB-INF/lib/ModuleJar-1.0.0.jar!/META-INF/kmodule.xml
null
...
Looking at the ModuleJar-1.0.0.jar closely it contains the kmodule.xml and pom.properties files inside it at proper place, but still it is throwing the aforementioned exception. The code snippet used to load the assets look something like the following.
public void contextInitialized(ServletContextEvent scevent) {
...
KieServices kservices = KieServices.Factory.get();
KieContainer kcontainer = kservices.getKieClasspathContainer();
...
KieSession kiesession = kcontainer.newKieSession("defaultKieSession");
...
kiesession.fireAllRules();
...
kiesession.dispose();
}
...
What could be causing this Unable to build index of kmodule.xml exception and how to fix it?
Environment
- Red Hat JBoss BRMS (BRMS)
- 6.0.0
- Websphere Application Server (WAS)
- 8.5.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
