Details
-
Bug
-
Resolution: Done
-
Major
-
5.3.0.Final
-
None
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.