Uploaded image for project: 'JBRULES'
  1. JBRULES
  2. JBRULES-3347

ResourceChangeScanner trying to scan rule file when instead the change set contains a package only

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

    XMLWordPrintable

Details

    Description

      1.) Create a KnowledgeBase using a rule file (DRL) on the classpath. The rule file has to contain a Drools function.
      2.) Serialize the the KnowledgeBase to the file system.
      3.) Create a changeset definition that adds the serialized package only.
      4.) Create a client that creates a KnowledgeAgent and apply the changeset. The class path should not contain the original rule files.
      5.) Start the ResourceChangeScanner

      This will lead to a NPE in the ResourceChangeScannerImpl:
      Exception in thread "Thread-0" java.lang.NullPointerException
      at org.drools.io.impl.ClassPathResource.getURL(ClassPathResource.java:124)
      at org.drools.io.impl.ClassPathResource.getLastModified(ClassPathResource.java:139)
      at org.drools.io.impl.ResourceChangeScannerImpl.scan(ResourceChangeScannerImpl.java:166)
      at org.drools.io.impl.ResourceChangeScannerImpl$ProcessChangeSet.run(ResourceChangeScannerImpl.java:311)
      at java.lang.Thread.run(Unknown Source)

      The reason for this seems to be:
      In private method KnowledgeAgentImpl.buildResourceMapping the function's resource (the DRL file) is retrieved and added to the registered resources . But the client is not distributed with the rule file on its classpath.

      Attachments

        Activity

          People

            mfusco@redhat.com Mario Fusco
            mws1_jira Michael Schnitzler (Inactive)
            Archiver:
            rhn-support-ceverson Clark Everson

            Dates

              Created:
              Updated:
              Resolved:
              Archived:

              PagerDuty