Juan Carlos Garcia created DROOLS-1158:
------------------------------------------
Summary: NullpointerException when trying to reuse KnowledgePackage into a
new KnowledgeBase
Key: DROOLS-1158
URL:
https://issues.jboss.org/browse/DROOLS-1158
Project: Drools
Issue Type: Bug
Affects Versions: 6.4.0.Final, 6.3.0.Final
Reporter: Juan Carlos Garcia
Assignee: Mark Proctor
Attachments: drools-reusepackage.tar
Having a set of DecisionTables which KnowledgePackage are cached, after we detect a change
in the filesystem, rebuild the new XLS file and try to create a new KnowledgeBase with the
new KnowledgePackage + the rest of the packages that are are cached it fails with a NPE
internally in Drools.
After debugging and putting a break point into the *MvelConstraint.java:619*, it shows it
is trying to look for a packageName which hasn't being loaded yet in the new kbase.
I have attached a project with a testcase that shows the problem, it has 2 DecisionTable
which i had to cut down a little bit (from our real files) and removes some sensitive
information (replacing some of text with FOO-BAR).
{code}
java.lang.NullPointerException
at org.drools.core.rule.constraint.MvelConstraint.equals(MvelConstraint.java:619)
at org.drools.core.reteoo.AlphaNode.internalEquals(AlphaNode.java:199)
at org.drools.core.common.BaseNode.thisNodeEquals(BaseNode.java:194)
at
org.drools.core.reteoo.CompositeObjectSinkAdapter.getMatchingNode(CompositeObjectSinkAdapter.java:531)
at org.drools.core.reteoo.builder.BuildUtils.attachNode(BuildUtils.java:121)
at
org.drools.core.reteoo.builder.PatternBuilder.buildAlphaNodeChain(PatternBuilder.java:332)
at
org.drools.core.reteoo.builder.PatternBuilder.attachAlphaNodes(PatternBuilder.java:313)
at
org.drools.core.reteoo.builder.PatternBuilder.attachPattern(PatternBuilder.java:130)
at org.drools.core.reteoo.builder.PatternBuilder.build(PatternBuilder.java:78)
at
org.drools.core.reteoo.builder.GroupElementBuilder$AndBuilder.build(GroupElementBuilder.java:108)
at
org.drools.core.reteoo.builder.GroupElementBuilder.build(GroupElementBuilder.java:68)
at
org.drools.core.reteoo.builder.ReteooRuleBuilder.addSubRule(ReteooRuleBuilder.java:161)
at
org.drools.core.reteoo.builder.ReteooRuleBuilder.addRule(ReteooRuleBuilder.java:133)
at org.drools.core.reteoo.ReteooBuilder.addRule(ReteooBuilder.java:106)
at org.drools.core.impl.KnowledgeBaseImpl.addRule(KnowledgeBaseImpl.java:1567)
at org.drools.core.impl.KnowledgeBaseImpl.addRule(KnowledgeBaseImpl.java:1547)
at
org.drools.core.impl.KnowledgeBaseImpl.internalAddPackages(KnowledgeBaseImpl.java:920)
at org.drools.core.impl.KnowledgeBaseImpl.access$000(KnowledgeBaseImpl.java:117)
at org.drools.core.impl.KnowledgeBaseImpl$1.run(KnowledgeBaseImpl.java:708)
at
org.drools.core.impl.KnowledgeBaseImpl.enqueueModification(KnowledgeBaseImpl.java:716)
at org.drools.core.impl.KnowledgeBaseImpl.addPackages(KnowledgeBaseImpl.java:705)
at
org.drools.core.impl.KnowledgeBaseImpl.addKnowledgePackages(KnowledgeBaseImpl.java:273)
at
org.drools.impl.adapters.KnowledgeBaseAdapter.addKnowledgePackages(KnowledgeBaseAdapter.java:62)
at
bug.demo.BugReloadableDecisionTableTest.addRuleSetToKnowledgeBase(BugReloadableDecisionTableTest.java:63)
at
bug.demo.BugReloadableDecisionTableTest.testReuseKnowledgePackage(BugReloadableDecisionTableTest.java:53)
{code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)