[
https://issues.jboss.org/browse/JBRULES-2981?page=com.atlassian.jira.plug...
]
Mark Proctor reassigned JBRULES-2981:
-------------------------------------
Assignee: Edson Tirelli (was: Mark Proctor)
[Regression in 5.2.0.M2]: NPE during rule evaluation on
MVELPredicateExpression.evaluate(MVELPredicateExpression.java:82)
-------------------------------------------------------------------------------------------------------------------------
Key: JBRULES-2981
URL:
https://issues.jboss.org/browse/JBRULES-2981
Project: Drools
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: drools-core (expert)
Affects Versions: 5.2.0.M2
Environment: <properties>
<drools.version>5.2.0.M2</drools.version>
<drools.planner.version>5.2.0.M2</drools.planner.version>
</properties>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-core</artifactId>
<version>${drools.version}</version>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>knowledge-api</artifactId>
<version>${drools.version}</version>
</dependency>
<dependency>
<groupId>org.drools.planner</groupId>
<artifactId>drools-planner-core</artifactId>
<version>${drools.planner.version}</version>
</dependency>
Reporter: Roman Novak
Assignee: Edson Tirelli
Priority: Critical
Fix For: 5.2.0.CR1
The following Rule worked in Version 5.2.0.M1 of drools-core and drools-api.
It fails with NPE (s. details below) in Version 5.2.0.M2 of drools-core and
knowledge-api.
Tested with drools-planner-core 5.1.0 and 5.2.0.M2 => both work.
Dialect in DRL file is "java".
import org.joda.time.Interval;
public class MediumBookingOpt implements Serializable {
private static final long serialVersionUID = 5616820300463695243L;
private Long mediId;
private Interval timeInterval;
...
DRL FILE:
...
dialect "java"
...
query "queryMediumBookingExistsAfter"
$mbo1: MediumBookingOpt ();
not MediumBookingOpt( mediId == $mbo1.mediId,
eval(timeInterval.isAfter($mbo1.getTimeInterval()))
)
end
org.drools.RuntimeDroolsException: Exception executing predicate
timeInterval.isAfter($mbo1.getTimeInterval())
at
org.drools.rule.PredicateConstraint.isAllowedCachedLeft(PredicateConstraint.java:321)
at
org.drools.common.DoubleBetaConstraints.isAllowedCachedLeft(DoubleBetaConstraints.java:168)
at org.drools.reteoo.NotNode.assertLeftTuple(NotNode.java:85)
at
org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:189)
at
org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:64)
at org.drools.reteoo.JoinNode.assertLeftTuple(JoinNode.java:100)
at
org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:189)
at
org.drools.reteoo.SingleLeftTupleSinkAdapter.createAndPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:138)
at org.drools.reteoo.LeftInputAdapterNode.assertObject(LeftInputAdapterNode.java:141)
at
org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:59)
at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:360)
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:185)
at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:143)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:332)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:917)
at org.drools.reteoo.ReteooWorkingMemory.getQueryResults(ReteooWorkingMemory.java:164)
<SNIP>
at
org.drools.planner.core.move.factory.CachedMoveFactory.solvingStarted(CachedMoveFactory.java:36)
at
org.drools.planner.core.localsearch.decider.selector.MoveFactorySelector.solvingStarted(MoveFactorySelector.java:55)
at
org.drools.planner.core.localsearch.decider.selector.CompositeSelector.solvingStarted(CompositeSelector.java:55)
at
org.drools.planner.core.localsearch.decider.DefaultDecider.solvingStarted(DefaultDecider.java:94)
at
org.drools.planner.core.localsearch.DefaultLocalSearchSolver.solvingStarted(DefaultLocalSearchSolver.java:119)
at
org.drools.planner.core.localsearch.DefaultLocalSearchSolver.solveImplementation(DefaultLocalSearchSolver.java:67)
at org.drools.planner.core.solver.AbstractSolver.solve(AbstractSolver.java:120)
<SNIP>
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at
org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at
org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:82)
at
org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:240)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:44)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at
org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at
org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:180)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.NullPointerException
at
org.drools.base.mvel.MVELPredicateExpression.evaluate(MVELPredicateExpression.java:82)
at
org.drools.rule.PredicateConstraint.isAllowedCachedLeft(PredicateConstraint.java:314)
... 60 more
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira