Uploaded image for project: 'JBoss BRMS Platform'
  1. JBoss BRMS Platform
  2. RHBRMS-1648

KIE module injection through CDI does not work in container

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 6.0.0
    • 6.0.0
    • BRE
    • Release Notes
    • ER2
    • Hide
      Cause: The KIE module injection through CDI does not work in container as the Drools resource loading mechanism differs with the JBoss EAP application server environment which now uses the JBoss VFS.

      Consequence: Drools was unable to locate the KieModule on the classpath as the pom.properties file resides in a directory which is named according to the maven artifact and the standard java resource loading mechanism failed to
      locate it.

      Fix: This issue has been resolved and the application defines a CDI bean which is able to inject a KieSession defined in kmodule.xml.

      Result: CDI injection of Drools KieBase and KieSession with EAP is now working.
      Show
      Cause: The KIE module injection through CDI does not work in container as the Drools resource loading mechanism differs with the JBoss EAP application server environment which now uses the JBoss VFS. Consequence: Drools was unable to locate the KieModule on the classpath as the pom.properties file resides in a directory which is named according to the maven artifact and the standard java resource loading mechanism failed to locate it. Fix: This issue has been resolved and the application defines a CDI bean which is able to inject a KieSession defined in kmodule.xml. Result: CDI injection of Drools KieBase and KieSession with EAP is now working.

      Description of problem:

      Injection of KIE module through CDI fails on JBoss EAP 6.0/6.1 due to wrong processing of resource URI when loading pom.properties in ClasspathKieProject.

      Version-Release number of selected component (if applicable):

      BRMS 6.0.0.Beta1
      EAP 6.0, 6.1.ER4

      How reproducible:

      Deploy the attached reproducer WAR. Deployment fails, server.log contains the following error (see attachment for all errors in log):

      15:40:29,923 INFO [stdout] (MSC service thread 1-2) kmodules: vfs:/content/kie-cdi-war-web-app-1.0.0-SNAPSHOT.war/WEB-INF/lib/kie-cdi-war-kie-module-1.0.0-SNAPSHOT.jar/META-INF/kmodule.xml
      15:40:29,939 ERROR [org.drools.compiler.kie.builder.impl.ClasspathKieProject] (MSC service thread 1-2) Unable to load pom.properties from/content/kie-cdi-war-web-app-1.0.0-SNAPSHOT.war/WEB-INF/lib/kie-cdi-war-kie-module-1.0.0-SNAPSHOT.jar as jarPath cannot be found
      /content/kie-cdi-war-web-app-1.0.0-SNAPSHOT.war/WEB-INF/lib/kie-cdi-war-kie-module-1.0.0-SNAPSHOT.jar

      The first log line shows that ClasspathKieProject located kmodule.xml at URL starting with protocol 'vfs:'. Later, in method fixURLFromKProjectPath, the protocol prefix is removed, leading to URL /content/kie-cdi-war-web-app-1.0.0-SNAPSHOT.war/WEB-INF/lib/kie-cdi-war-kie-module-1.0.0-SNAPSHOT.jar which now references absolute path which is wrong.

      Steps to Reproduce:
      1. Deploy attached reproducer WAR on EAP 6.
      2. Watch server.log for deployment errors.

      Actual results:

      Deployment fails due to failed injection.

      Expected results:

      Application deploys successfully and writes INFO message into server.log.

      Additional info:

      This issue blocks further testing if KIE module injection through CDI. It also renders the CDI feature unusable in real environment (e.g. some web or EJB container with CDI).

            mfusco@redhat.com Mario Fusco
            mwinkler@redhat.com Marek Winkler (Inactive)
            Archiver:
            rhn-support-ceverson Clark Everson
            Marek Winkler Marek Winkler (Inactive)
            Marek Winkler Marek Winkler (Inactive)
            Cheng Zhang (Inactive), Lukáš Petrovický (Inactive), Marek Baluch, Marek Winkler (Inactive), Mario Fusco, Rajesh Rajasekaran, swati sen (Inactive), Vikram Goyal (Inactive)

              Created:
              Updated:
              Resolved:
              Archived: