[jboss-jira] [JBoss JIRA] Resolved: (JBRULES-2223) ArrayIndexOutOfBoundsException in AbstractRuleBase.getStatefulSessions()

Mark Proctor (JIRA) jira-events at lists.jboss.org
Sat Apr 23 21:31:18 EDT 2011


     [ https://issues.jboss.org/browse/JBRULES-2223?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Proctor resolved JBRULES-2223.
-----------------------------------

    Resolution: Won't Fix


4.0.7 is not supported at a community level. Please try with 5.2 and let us know if the problem still remains. Also I don't know what impact terrecota has on this, please try and reproduce the issue wthout it.

> ArrayIndexOutOfBoundsException in AbstractRuleBase.getStatefulSessions()
> ------------------------------------------------------------------------
>
>                 Key: JBRULES-2223
>                 URL: https://issues.jboss.org/browse/JBRULES-2223
>             Project: Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 4.0.7
>            Reporter: Assen Todorov
>            Assignee: Mark Proctor
>            Priority: Critical
>
> The following exception was thrown on a clustered application, based on Terracotta & JBoss Drools (4.0.7).
> {code}
> java.lang.ArrayIndexOutOfBoundsException: 0
>         at org.drools.util.ObjectHashSet.toArray(ObjectHashSet.java:152)
>         at org.drools.common.AbstractRuleBase.getStatefulSessions(AbstractRuleBase.java:724)
>         .......
> {code}
> The code :
> {code}
>    /**
>     * Creates a new rule base if necesarry.
>     * @param aRuleSet the rule set for the new rule base.
>     * @throws RuleConversionException if the rule engine has a problem with rule set compilation and loading.
>     */
>    private void createRuleBase(final RuleSet aRuleSet) throws RuleConversionException
>    {
>       Check.notNull(aRuleSet, "aRuleSet");
>       final String code = aRuleSet.getCode();
>       Check.notNull(code, "aRuleSet.getCode()");
>       Check.notEmpty(code, "aRuleSet.getCode()");
>       final ECRC ecrc = new ECRC();
>       ecrc.update(code);
>       final long crc = ecrc.getValue();
>       synchronized(ruleBaseCache)
>       {
>          ruleBase = ruleBaseCache.get(crc);
>          if(ruleBase == null)
>          {
>             ruleBase = loadRuleBaseFromCode(code);
>             ruleBaseCache.put(crc, ruleBase);
>          }
>          else {
>             // rulebase already exist
>             final StatefulSession[] sessions = ruleBase.getStatefulSessions();
>             if(sessions.length > 0) {
>                // old sessions (working memories exist)
>                for(StatefulSession session: sessions) {
>                   // clear the working memory
>                   session.dispose();
>                }
>             }
>          }
>       }
>    }
> {code}
> The class where this method is defined, is declared as _instrumented-classes_  in the Terracotta configuration.
> Hope this helps !

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