Uploaded image for project: 'JBRULES'
  1. JBRULES
  2. JBRULES-1415

Certain uses of from causes NullPointerException in WorkingMemoryLogger

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 4.0.3
    • Fix Version/s: 4.0.5, 5.0.0.M1
    • Component/s: None
    • Labels:
      None

      Description

      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.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                mark.proctor Mark Proctor
                Reporter:
                mattias.nilsson Mattias Nilsson
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: