[jboss-jira] [JBoss JIRA] (JBRULES-3718) java.lang.NullPointerException at org.mvel2.ast.IntSub.getReducedValueAccelerated

Mario Fusco (JIRA) jira-events at lists.jboss.org
Fri Jan 18 08:05:21 EST 2013


    [ https://issues.jboss.org/browse/JBRULES-3718?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12748905#comment-12748905 ] 

Mario Fusco commented on JBRULES-3718:
--------------------------------------

The fact that the Exception doesn't have impact on your results is not odd. It is thrown when drools tries to compile a constraint converting it in a java class in order to run it in compiled mode (faster) instead of the interpreted one using mvel. Since in your particular case the compilation fails the compiled constrained is discarded and its evaluation continues in interpreted mode. It means that the evaluation of the constraint is always correct (just a bit slower than how it could be in compiled mode) and this is why you don't see any difference in the final result.

However I am not able to reproduce this issue at the moment, so it would be great if you could attach your project to this ticket together with some quick instruction on how to reproduce the problem.
                
> java.lang.NullPointerException at org.mvel2.ast.IntSub.getReducedValueAccelerated
> ---------------------------------------------------------------------------------
>
>                 Key: JBRULES-3718
>                 URL: https://issues.jboss.org/browse/JBRULES-3718
>             Project: JBRULES
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: drools-core
>    Affects Versions: 5.5.0.Final
>         Environment: Windows 7 64bit -  Java 1.7.0 
> Drools-planner 5.5.0.Final
>  -> Drools-core 5.5.0.Final 
>  -> mvel2 2.1.3.Final
>            Reporter: Michiel Vermandel
>            Assignee: Mario Fusco
>
> When I run my planning I get now and then the stacktrace as mentioned below.
> It happens about 1 in 5 times during running a JUnit test on small amount of planning entities and problem facts.
> It started after adding my last rule:
> rule "tasksInSameCommunityMustBeChained"
>     when
>         $lead : Task(this==lead, period!=null, communityId!= null, $communityId : communityId)
>         not ( Task(this==lead, communityId == $communityId, id != $lead.id, ($lead.startPeriodId-1) <= endPeriodId && ($lead.endPeriodId+1) >= startPeriodId ) )
>     then
>         insertLogical(new IntConstraintOccurrence("tasksInSameCommunityMustBeChained", ConstraintType.NEGATIVE_HARD, Importance.chainedPeriod, $communityId, $lead, $lead.getStartPeriodId()));
> end 
> Stack trace: 
> Exception in thread "Thread-1" java.lang.NullPointerException
> 	at org.mvel2.ast.IntSub.getReducedValueAccelerated(IntSub.java:17)
> 	at org.mvel2.compiler.ExecutableAccessor.getValue(ExecutableAccessor.java:38)
> 	at org.mvel2.ast.Substatement.getReducedValueAccelerated(Substatement.java:44)
> 	at org.mvel2.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.java:108)
> 	at org.mvel2.ast.And.getReducedValueAccelerated(And.java:34)
> 	at org.mvel2.MVELRuntime.execute(MVELRuntime.java:85)
> 	at org.mvel2.compiler.CompiledExpression.getDirectValue(CompiledExpression.java:123)
> 	at org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:119)
> 	at org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:113)
> 	at org.mvel2.MVEL.executeExpression(MVEL.java:930)
> 	at org.drools.rule.constraint.MvelConditionEvaluator.evaluate(MvelConditionEvaluator.java:70)
> 	at org.drools.rule.constraint.MvelConditionEvaluator.ensureBranchEvaluation(MvelConditionEvaluator.java:117)
> 	at org.drools.rule.constraint.MvelConditionEvaluator.ensureCompleteEvaluation(MvelConditionEvaluator.java:102)
> 	at org.drools.rule.constraint.MvelConditionEvaluator.ensureCompleteEvaluation(MvelConditionEvaluator.java:90)
> 	at org.drools.rule.constraint.MvelConditionEvaluator.getAnalyzedCondition(MvelConditionEvaluator.java:82)
> 	at org.drools.rule.constraint.MvelConstraint.executeJitting(MvelConstraint.java:270)
> 	at org.drools.rule.constraint.MvelConstraint.access$200(MvelConstraint.java:51)
> 	at org.drools.rule.constraint.MvelConstraint$ConditionJitter.run(MvelConstraint.java:250)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> 	at java.lang.Thread.run(Unknown Source)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list