[jboss-jira] [JBoss JIRA] Commented: (JBRULES-1415) Certain uses of from causes NullPointerException in WorkingMemoryLogger
Mattias Nilsson (JIRA)
jira-events at lists.jboss.org
Sat Jan 12 17:48:23 EST 2008
[ http://jira.jboss.com/jira/browse/JBRULES-1415?page=comments#action_12394831 ]
Mattias Nilsson commented on JBRULES-1415:
------------------------------------------
I checked out the source code and found that the problem seems to be solved if I make the following change in method extractDeclarations in class WorkingMemoryLogger.
From:
final Object value = declaration.getValue( (InternalWorkingMemory) workingMemory, workingMemory.getObject( handle ) );
To:
final Object value = declaration.getValue( (InternalWorkingMemory) workingMemory, handleImpl.getObject());
But maybe it isn't safe to call handleImpl.getObject instead of workingMemory.getObject?
Regards,
Mattias
> 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
> Attachments: testcase.zip
>
>
> This rule causes a NullPointerException when WorkingMemoryFileLogger is activated. Without the logger the rule works fine.
> {quote}
> rule "TestRule"
> when
> A( theList : list )
> B( theName : name ) from theList
> then
> System.out.println( "ok" );
> end
> {quote}
> 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)
> . . .
--
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
More information about the jboss-jira
mailing list