Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drools 6.3.0.Final #1

Open
lindsaythurmond opened this issue Oct 23, 2015 · 4 comments
Open

Drools 6.3.0.Final #1

lindsaythurmond opened this issue Oct 23, 2015 · 4 comments

Comments

@lindsaythurmond
Copy link

Any chance you are going to update this to work with Drools 6.3.0.Final? I attempted on my own but am having trouble getting past some null pointers that it throws when you update. For example running KieSessionRulesIncrementalUpdateAddedRulesTest#testAddedRulesDifferentDrl() gives a stacktrace like the following:

java.lang.NullPointerException
    at org.drools.core.reteoo.NodeTypeEnums.isBetaNode(NodeTypeEnums.java:88)
    at org.drools.core.phreak.RuleNetworkEvaluator.innerEval(RuleNetworkEvaluator.java:254)
    at org.drools.core.phreak.RuleNetworkEvaluator.outerEval(RuleNetworkEvaluator.java:166)
    at org.drools.core.phreak.RuleNetworkEvaluator.evaluateNetwork(RuleNetworkEvaluator.java:123)
    at org.drools.core.phreak.RuleExecutor.reEvaluateNetwork(RuleExecutor.java:194)
    at org.drools.core.phreak.RuleExecutor.evaluateNetworkAndFire(RuleExecutor.java:73)
    at org.drools.core.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:978)
    at org.drools.core.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1292)
    at org.drools.core.impl.StatefulKnowledgeSessionImpl.internalFireAllRules(StatefulKnowledgeSessionImpl.java:1294)
    at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1281)
    at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1260)
    at org.jboss.ddoyle.drools.demo.KieSessionRulesIncrementalUpdateAddedRulesTest.testAddedRulesDifferentDrl(KieSessionRulesIncrementalUpdateAddedRulesTest.java:125)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:78)
    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:212)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:68)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
@DuncanDoyle
Copy link
Owner

Yes, I can definitely do that. One question though, is that NPE thrown when using the rules in my example or are you using your own rules? We've recently fixed a number of bugs in Drools incremental update on master (Drools 6.4.0-SNAPSHOT) which have also been backported to the Drools 6.3.x branch.

@lindsaythurmond
Copy link
Author

I used the rules in your example with no changes other than the following properties in the pom.

<properties>
    <version.org.kie>6.3.0.Final</version.org.kie>
    <version.org.kie.test>6.3.0.Final</version.org.kie.test>
    <version.org.mvel>2.2.7.Final</version.org.mvel>
</properties>

@DuncanDoyle
Copy link
Owner

I've tested with Drools 6.3.0.Final and that indeed shows the NPE, and also a ClassCastException. I did expect that CCE, as we've solved that in 6.3.1-SNAPSHOT and 6.4.0-SNAPSHOT. However, the NPE still occurs on 6.4.0-SNAPSHOT as well.

The tests that fail are the tests in which I change the name of the .drl file on incremental update. In a real system, I would not recommend changing .drl filenames on incremental update anyway. Nevertheless, Drools should not throw an NPE when one does.

The other tests that fail seem to fail due to the new propagation queue implemented in Drools, which slightly changes when a rule is fired. So I think that's a problem in my unit-test assertions which I need to fix.

I'll create a small reproducer for the NPE, open a JIRA against Drools and discuss it with the Drools core engineers. I'll post the link to the JIRA here so you can track it. I'll also investigate the failing assertions and fix them.

@DuncanDoyle
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants