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

Solution Unverified - Updated -

Issue

  • The scenario looks something like this. There is a WAR which looks up for rule assets through Kie-classpath API from it's classpath where the rule assets are built and packaged into a Kie Jar (e.g.ModuleJar-1.0.0.jar) is lying inside <WAR>/WEB-INF/lib directory along with other Drools 6 related jars. The Kie Jar are built and fetched from a separate Red Hat JBoss BRMS 6.0.0 installation. Now, the entire WAR is packaged inside an exploded EAR and 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, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content