[
https://issues.jboss.org/browse/JBRULES-3347?page=com.atlassian.jira.plug...
]
Michael Schnitzler commented on JBRULES-3347:
---------------------------------------------
Executing the JUnit test will generate this output:
created knowledge package
(null: 3, 175): cvc-elt.1: Cannot find the declaration of element 'change-set'.
Exception in thread "Thread-1" 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)
rule 0 fired
rule 0 fired
DONE
Removing the function from DRL file will generate the same output - except for the
Exception.
Also, the resource scanner seems to be stopped after the exception has been thrown.
ResourceChangeScanner trying to scan rule file when instead the
change set contains a package only
--------------------------------------------------------------------------------------------------
Key: JBRULES-3347
URL:
https://issues.jboss.org/browse/JBRULES-3347
Project: Drools
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: drools-core
Affects Versions: 5.3.0.Final
Reporter: Michael Schnitzler
Assignee: Mark Proctor
Attachments: drools-test.zip
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.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira