[jboss-jira] [JBoss JIRA] Created: (JBRULES-3150) NPE in ObjectTypeConfigurationRegistry when accumulate returns null (and "quick hack for 5.2")

Wolfgang Laun (JIRA) jira-events at lists.jboss.org
Fri Jul 22 02:49:23 EDT 2011


NPE in ObjectTypeConfigurationRegistry when accumulate returns null (and "quick hack for 5.2")
----------------------------------------------------------------------------------------------

                 Key: JBRULES-3150
                 URL: https://issues.jboss.org/browse/JBRULES-3150
             Project: Drools
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: drools-core  (expert)
    Affects Versions: 5.2.0.Final
            Reporter: Wolfgang Laun
            Assignee: Mark Proctor
             Fix For: 5.2.1.Final


rule foo # the problem is usually better "hidden"
when
Object() from accumulate( Object(),
  init( Object res = null; )
  action( res = null; )
  result( res ) )
then
end

causes the exception as shown below, or similar.
A runtime diagnostic should tell the user (at least) that
an accumulate result is null.

ALSO, PLEASE NOTE THIS COMMENT in AccumulateNode.java:642!
// this is a quick hack for the 5.2 release


Exception in thread "main" java.lang.NullPointerException
	at org.drools.common.ObjectTypeConfigurationRegistry.getObjectTypeConf(ObjectTypeConfigurationRegistry.java:58)
	at org.drools.reteoo.AccumulateNode.evaluateResultConstraints(AccumulateNode.java:646)
	at org.drools.reteoo.AccumulateNode.assertLeftTuple(AccumulateNode.java:183)
	at org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:197)
	at org.drools.reteoo.SingleLeftTupleSinkAdapter.createAndPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:146)
	at org.drools.reteoo.LeftInputAdapterNode.assertObject(LeftInputAdapterNode.java:154)
	at org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:59)
	at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:204)
	at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:191)
	at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:332)
	at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:293)
	at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:905)
	at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:864)
	at org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:255)
	at match.Main.makeFacts(Main.java:120)
	at match.Main.execute(Main.java:98)
	at match.Main.main(Main.java:126)


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list