Uploaded image for project: 'Kogito'
  1. Kogito
  2. KOGITO-8608

Kogito cannot find DRL files when deployed in a JAR file.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.34.0.Final
    • 1.33.0.Final
    • Core Engine
    • None
    • 2023 Week 06-08 (from Feb 6)
    • Important

      We are deploying our Spring Boot Rules Engine service inside of a container in a JAR file.

      When we execute

       RuleUnitProvider.get().createRuleUnitInstance(appointmentAccessUnit); 

      we get the following error:

      java.lang.RuntimeException: Cannot find any rule unit for RuleUnitData of class:....AppointmentAccessUnit
      

      After debugging the code I found that the error occurs in RuleUnitProviderImpl::ruleResourcesForUnitClass (line 113 in 8.33.0.Final)

      The line

      Optional.ofNullable(new File(path).listFiles())
      

      looks for the DRL files in `file:/opt/dir/service/lib/rules-engine-1.0.0.jar!/com/site/dir/dir/v1/service/rules` which always comes up empty since the `listFiles` method doesn't really work with JAR files.

            rhn-support-tkobayas Toshiya Kobayashi
            code4dc@gmail.com Eugene Shvartsman (Inactive)
            Marian Macik Marian Macik
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: