[rules-users] NPE when using directory scanner and drl is incorrect. Possible bug! (Drools 4.0.7)

Przemysław Różycki P.Rozycki at amg.net.pl
Mon Mar 9 06:43:24 EDT 2009


Hi,

I think I found a bug.
When I use rule agent with directory scanner, and the rule that is being 
scanned contains a bug, then I receive a NPE instead of error message:

java.lang.NullPointerException 
 
 

         at 
org.drools.agent.FileScanner.readPackage(FileScanner.java:102) 
 
 

         at 
org.drools.agent.FileScanner.getChangeSet(FileScanner.java:79) 
 
 

         at 
org.drools.agent.FileScanner.loadPackageChanges(FileScanner.java:57) 
 
 

         at 
org.drools.agent.DirectoryScanner.loadPackageChanges(DirectoryScanner.java:43) 
 
 

         at 
org.drools.agent.RuleAgent.checkForChanges(RuleAgent.java:330) 
 
 

         at 
org.drools.agent.RuleAgent.refreshRuleBase(RuleAgent.java:298) 
 
 

         at org.drools.agent.RuleAgent.configure(RuleAgent.java:284) 
 
 

         at org.drools.agent.RuleAgent.init(RuleAgent.java:208) 
 
 

         at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:176) 
 
 

         at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:164)
... (further entries of stack trace contains my application's lines)

When I looked into code I found that DirectoryScanner object, used by 
the agent uses FileScanner object to scan each file in a directory. And 
the file scanner does not have a listener set. That's why the NPE is thrown.
It's difficult to find a bug in the rule.
I didn't find it in JIRA. If anyone knows, that it was reported, then I 
won't duplicate, otherwise, I think it is worth to create a report.

Best regards,
-- 
Przemysław Różycki
AMG.net, A Bull Group Company
ul. Łąkowa 29
90-554 Łódź
www.amg.net.pl




More information about the rules-users mailing list