[
https://issues.jboss.org/browse/DROOLS-1158?page=com.atlassian.jira.plugi...
]
Matteo Mortari commented on DROOLS-1158:
----------------------------------------
Hello [~jcgarciam], I've checked your description and your reproducer, but I would
kindly request for your feedback on the following questions, please?
.
* I've run the reproducer but it does not trigger the error/stacktrace you reported.
Ref. screenshot:
!screenshot-1.png|thumbnail!
I've just added slf4j-log4j dependency in order to see some drools logs, but your code
left unchanged indeed does not reproduce the error/stacktrace you reported.
Additionally, I've tried to increase the timeout in the test, still nothing. I've
moved drools version from 6.4.0.Final originally in your reproducer, to 6.3.0.Final as you
reported that was also an issue, still nothing. Can you advise on the attached reproducer
please, because is not triggering the error/stacktrace you reported.
Then I've explored your code, and I think part of it is using internal API. Based on
your use-case scenario reported in the description above (summarizing: _avoiding, as
possible, to completely rebuild the KB from the XLS files where most are unchanged_),
I'm wondering:
# wouldn't the KieScanner to monitor KJAR update be easier to use for this use-case
scenario?
Being the incremental update based at resource level, I was expecting should have
addressed your need described.
# if the KieScanner/KJAR usage is not suitable for any reason, wouldn't it be easier
to use the public Kie API to build the KieModule in programmatically, say following the
example ["4.2.6.10. Programmaticaly build a KieModule using Meta
Models"|http://docs.jboss.org/drools/release/6.4.0.Final/drools-docs...]
?
(trying to anticipate a possible follow-up question, on top of my head with that API
I'm not sure you can re-use KiePackages originating from another KieBase, but you
should be able to keep the manual caching currently done at least for the rendering of XLS
in DRL form?)
I hope this at least partially helps, and kindly awaiting for your feedback; thank you.
MM
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.3.0.Final, 6.4.0.Final
Reporter: Juan Carlos Garcia
Assignee: Mario Fusco
Attachments: drools-reusepackage.tar, screenshot-1.png
Having a set of DecisionTables which KnowledgePackages are cached in our application,
after we detect a change in any of those XLS files, we build a KnowledgePackages from it,
and then try to create a new KnowledgeBase with the new KnowledgePackages + the rest of
the cached one that that were not modified, but it fails with a NPE internally in Drools
(6.3.0 and 6.4.0)
This is not a problem for the drools version (6.0.1.Final) that we currently uses using
in production.
After debugging and putting a breakpoint into the *MvelConstraint.java:619*, it shows
that it is trying to look for a packageName which hasn't being loaded yet in the new
kbase (but belong to others XLS).
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)