[
http://jira.jboss.com/jira/browse/JBRULES-1415?page=all ]
Mark Proctor closed JBRULES-1415.
---------------------------------
Resolution: Done
Assignee: Mark Proctor (was: Kris Verlaenen)
Added test and fix, thank you. It's not idea to do the fix you recommended, but I
don't see a clean easy work around at the moment - as this our own class, I figured
it's ok. The reason for this bug is because the facthandle assigned to the declaration
is derived, thus it doesn't exist in the working memory.
Certain uses of from causes NullPointerException in
WorkingMemoryLogger
-----------------------------------------------------------------------
Key: JBRULES-1415
URL:
http://jira.jboss.com/jira/browse/JBRULES-1415
Project: JBoss Drools
Issue Type: Bug
Security Level: Public(Everyone can see)
Affects Versions: 4.0.3
Reporter: Mattias Nilsson
Assigned To: Mark Proctor
Fix For: 4.0.5, 5.0.0-M1
Attachments: testcase.zip
This rule causes a NullPointerException when WorkingMemoryFileLogger is activated.
Without the logger the rule works fine.
rule "TestRule"
when
A( theList : list )
B( theName : name ) from theList
then
System.out.println( "ok" );
end
Seems to be the assigning of variable theName that causes the problem. If i remove
"theName : name" there is no NullPointerException. Here is the stack trace:
java.lang.NullPointerException
at org.drools.base.com.sample.DroolsTest$B15799300$getName.getValue(Unknown
Source)
at org.drools.base.ClassFieldExtractor.getValue(ClassFieldExtractor.java:127)
at org.drools.rule.Declaration.getValue(Declaration.java:197)
at
org.drools.audit.WorkingMemoryLogger.extractDeclarations(WorkingMemoryLogger.java:267)
at
org.drools.audit.WorkingMemoryLogger.activationCreated(WorkingMemoryLogger.java:201)
at
org.drools.event.AgendaEventSupport.fireActivationCreated(AgendaEventSupport.java:75)
at org.drools.reteoo.RuleTerminalNode.assertTuple(RuleTerminalNode.java:331)
. . .
I have attached a testcase that reproduces the problem.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira