[jboss-jira] [JBoss JIRA] Created: (JBRULES-611) ArrayIndexOutOfBoundsException when creating / executing rules

Tomer Cohen (JIRA) jira-events at jboss.com
Wed Jan 17 11:37:53 EST 2007


ArrayIndexOutOfBoundsException when creating / executing rules
--------------------------------------------------------------

                 Key: JBRULES-611
                 URL: http://jira.jboss.com/jira/browse/JBRULES-611
             Project: JBoss Rules
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: All
    Affects Versions: 3.0.5, 3.0.1
            Reporter: Tomer Cohen
         Assigned To: Mark Proctor



When creating the following rule:
rule forwardRequest
        //no-loop true
        when
            exists(RulesFact(fact == Facts.PC_STATUS_UPDATED))
            exists(RulesFact(fact == Facts.PC_DISABLED)) || exists(RulesFact(fact == Facts.PERFORMED_REQUEST_PC))
            not(RulesFact(fact == Facts.REQUEST_DENIED))
            not(ClientHttpResponse())
            not(RulesFact(fact == Facts.ABORT_REQUEST_ERROR))
        then
            operationsInvoker.invokeOperation("com.flash.http.proxy.impls.operations.executeRequest.ExecuteRequestOperation",context);
            assert(new RulesFact(Facts.REQUEST_FORWARDED_TO_THE_INTERNET));

end

The following exception is thrown:

Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
at org.drools.reteoo.FactHandleList.get(Unknown Source)
	at org.drools.reteoo.TupleKey.get(Unknown Source)
	at org.drools.reteoo.ReteTuple.get(Unknown Source)
	at org.drools.reteoo.RightInputAdapterNode.assertTuple(Unknown Source)
	at org.drools.reteoo.TupleSource.propagateAssertTuple(Unknown Source)
	at org.drools.reteoo.NotNode.assertTuple(Unknown Source)
	at org.drools.reteoo.LeftInputAdapterNode.createAndAssertTuple(Unknown Source)
	at org.drools.reteoo.LeftInputAdapterNode.assertObject(Unknown Source)
	at org.drools.reteoo.ObjectSource.propagateAssertObject(Unknown Source)
	at org.drools.reteoo.ObjectTypeNode.assertObject(Unknown Source)
	at org.drools.reteoo.Rete.assertObject(Unknown Source)
	at org.drools.reteoo.ReteooRuleBase.assertObject(Unknown Source)
	at org.drools.reteoo.ReteooRuleBase.newWorkingMemory(Unknown Source)
	at org.drools.common.AbstractRuleBase.newWorkingMemory(Unknown Source)
	at org.drools.jsr94.rules.admin.RuleExecutionSetImpl.newWorkingMemory(Unknown Source)
	at org.drools.jsr94.rules.AbstractRuleSessionImpl.newWorkingMemory(Unknown Source)
	at org.drools.jsr94.rules.AbstractRuleSessionImpl.initWorkingMemory(Unknown Source)
	at org.drools.jsr94.rules.StatefulRuleSessionImpl.<init>(Unknown Source)
	at org.drools.jsr94.rules.RuleRuntimeImpl.createRuleSession(Unknown Source)
	at com.flash.ruleEngine.RulesSessionFactoryImpl.createStatefulRuleSession(RulesSessionFactoryImpl.java:55)

Moving the  condition with the | in it, the rules are compiled fine, but during the execution of the rules, the consequence of the following rule fails:

rule updateTransactionInfo
        when
            exists(RulesFact(fact == Facts.USER_DATA_UPDATED))
        then
            operationsInvoker.invokeOperation("com.flash.http.proxy.impls.operations.updateTransaction.UpdateTransactionInfoOperation",context);
            assert(new RulesFact(Facts.TRANSACTIONS_DATA_UPDATED));
end

With the exception: 
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
	at org.drools.reteoo.FactHandleList.get(Unknown Source)
	at org.drools.reteoo.TupleKey.get(Unknown Source)
	at org.drools.reteoo.ReteTuple.get(Unknown Source)
	at org.drools.reteoo.RightInputAdapterNode.assertTuple(Unknown Source)
	at org.drools.reteoo.TupleSource.propagateAssertTuple(Unknown Source)
	at org.drools.reteoo.NotNode.assertTuple(Unknown Source)
	at org.drools.reteoo.TupleSource.propagateAssertTuple(Unknown Source)
	at org.drools.reteoo.NotNode.retractObject(Unknown Source)
	at org.drools.reteoo.ObjectSource.propagateRetractObject(Unknown Source)
	at org.drools.reteoo.RightInputAdapterNode.retractTuple(Unknown Source)
	at org.drools.reteoo.TupleSource.propagateRetractTuple(Unknown Source)
	at org.drools.reteoo.NotNode.assertObject(Unknown Source)
	at org.drools.reteoo.ObjectSource.propagateAssertObject(Unknown Source)
	at org.drools.reteoo.AlphaNode.assertObject(Unknown Source)
	at org.drools.reteoo.ObjectSource.propagateAssertObject(Unknown Source)
	at org.drools.reteoo.ObjectTypeNode.assertObject(Unknown Source)
	at org.drools.reteoo.Rete.assertObject(Unknown Source)
	at org.drools.reteoo.ReteooRuleBase.assertObject(Unknown Source)
	at org.drools.reteoo.ReteooWorkingMemory.doAssertObject(Unknown Source)
	at org.drools.common.AbstractWorkingMemory.assertObject(Unknown Source)
	at org.drools.base.DefaultKnowledgeHelper.assertObject(Unknown Source)
	at org.drools.base.DefaultKnowledgeHelper.assertObject(Unknown Source)
	at com.flash.httpProxy.Rule_updateTransactionInfo_0.consequence(Rule_updateTransactionInfo_0.java:13)
	at com.flash.httpProxy.Rule_updateTransactionInfo_0ConsequenceInvoker.evaluate(Rule_updateTransactionInfo_0ConsequenceInvoker.java:20)

I have this issue with version 3.0.1, upgrading to version 3.0.5 did not solve this issue.

I have looked through the site and found the following jira :

http://jira.jboss.org/jira/browse/JBRULES-183;jsessionid=794BA6EAA2A791F1EEE3EBC1713811FD?page=com.atlassian.jira.plugin.ext.subversion:subversion-commits-tabpanel

Which seems to be talking about the same problem, however it was supposed to be fixed on 3.0 RC2 , so i am not sure if the issues are related.

If you need any more details, please let me know.
thanks,
Tomer

-- 
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