[
https://issues.jboss.org/browse/JBRULES-2932?page=com.atlassian.jira.plug...
]
Laird Nelson commented on JBRULES-2932:
---------------------------------------
This end-user-authored rule:
{code}
rule "AfterBINTK360_C"
agenda-group "BINTK360"
when
$session : Session( $currentQuestion : currentQuestion != null, currentQuestion.ID ==
"BINTK360" )
$responseToTest : Response( question.ID == "BINTK359", session == $session
)
exists(AnswerSelection( response == $responseToTest, selected == true, answer != null,
answer.ID == 6))
not(exists(AnswerSelection( response == $responseToTest, selected == true, answer !=
null, answer.ID ( > 1 && < 4 ) || == 5 )))
then
$session.currentQuestion = $session.assessment.getQuestion("BINTK364")
end
{code}
...causes the NPE. Note this portion of the rule (where the problem is):
{code}
answer.ID ( > 1 && < 4 ) || == 5
{code}
This suspicious syntax is understood by Drools 5.1.1. I don't know if it _should_ be,
but there you have it.
Regression: NullPointerException in PatternBuilder.build()
----------------------------------------------------------
Key: JBRULES-2932
URL:
https://issues.jboss.org/browse/JBRULES-2932
Project: Drools
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: drools-compiler (expert)
Affects Versions: 5.2.0.M1
Reporter: Laird Nelson
Assignee: Mark Proctor
Actually using 5.2.0-SNAPSHOT as of today (March 24, 2011).
I get this:
{code}
Caused by: java.lang.NullPointerException
at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:323)
at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:268)
at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:107)
at org.drools.rule.builder.GroupElementBuilder.build(GroupElementBuilder.java:65)
at org.drools.rule.builder.GroupElementBuilder.build(GroupElementBuilder.java:39)
at org.drools.rule.builder.GroupElementBuilder.build(GroupElementBuilder.java:65)
at org.drools.rule.builder.GroupElementBuilder.build(GroupElementBuilder.java:39)
at org.drools.rule.builder.GroupElementBuilder.build(GroupElementBuilder.java:65)
at org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:80)
at org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:1313)
at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:664)
at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:310)
at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:483)
at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)
at
org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(KnowledgeAgentImpl.java:697)
at
org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(KnowledgeAgentImpl.java:675)
at
org.drools.agent.impl.KnowledgeAgentImpl.incrementalBuildResources(KnowledgeAgentImpl.java:882)
at
org.drools.agent.impl.KnowledgeAgentImpl.buildKnowledgeBase(KnowledgeAgentImpl.java:644)
at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:188)
at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:170)
{code}
This is on a monstrous rules file that has compiled fine for months.
The line in question says this:
{code}
for ( Iterator<BaseDescr> it = result.getDescrs().iterator(); it.hasNext(); ) {
{code}
I have not yet fired up the debugger to see which rule is causing the problem.
From reading other bug reports, it might be that getDescrs() returns null.
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira