[rules-users] java.lang.ArrayIndexOutOfBoundsException thrown in mvel2's compiler when running drools5.3 final.

pf_miles miles.wy.1 at gmail.com
Fri Mar 9 02:08:21 EST 2012


Sorrry for the latency of my reply...
I was surrounded by other things these days~

So, there are many rules in our system(about hundreds of them). Most of the
time, the "not very busy" time period, this problem does not occur.

And when the problem occurs, I discovered that it is always the line:
    Helper.containsAny(offerSubject, ((Set)colMap.get("_set_54")))
or:
    Helper.containsAny(offerPublishIpArea, ((Set)colMap.get("_set_54")))
where the exceptions were thrown.As my original post shows.

The "Helper" class is a handful of static functions, which returns boolean
results, to extend some special predicate which is not supported by drools5
now.

The 'containsAny' method, for example, it checks if the first argument(a
string) contains any one of strings in the set passed in as the second
argument.

The real drl file was here:

package com.alibaba.china.ruleservice.dsl.binding.drools5;

import com.alibaba.china.avatar.offer.rulematch.facts.OfferEntity;
import com.alibaba.china.avatar.offer.rulematch.facts.EventContext;
import com.alibaba.china.avatar.offer.rulematch.facts.MemberInfo;
import java.util.Set;
import java.util.HashSet;
import java.util.Map;
import java.util.HashMap;
import java.util.Collection;
import java.util.Date;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.RoundingMode;
import com.alibaba.china.ruleservice.dsl.binding.drools5.CustomOpInvoker;
import
com.alibaba.china.ruleservice.dsl.binding.drools5.CustomActionOpInvoker;
import com.alibaba.china.ruleservice.dsl.binding.drools5.translate.Helper;
import com.alibaba.china.ruleservice.dsl.binding.drools5.InferenceCounter;

global java.util.Map colMap;
global java.util.Map dateMap;
global com.alibaba.china.ruleservice.dsl.binding.drools5.CustomOpInvoker
customOpInvoker;
global
com.alibaba.china.ruleservice.dsl.binding.drools5.CustomActionOpInvoker
caoInvoker;
global com.alibaba.china.ruleservice.dsl.binding.drools5.InferenceCounter
inferenceCounter;

rule "23110"
when

mf2:MemberInfo(memberType == "free")
mf1:EventContext(Helper.containsAny(offerPublishIpArea,
((Set)colMap.get("_set_1"))))
mf0:OfferEntity(Helper.containsAny(offerSubject,
((Set)colMap.get("_set_0"))) && Helper.strContains(offerCategory, "usb") &&
offerUnitPrice < 16.88)

then



end

this file contains hundreds of rules, but I only shows you the one which
caused the problem(a.k.a where the ArrayIndexOutOfBoundsException thrown..);

I suspect that there are some thread safety issues in the mvel2 compiler,
because the problem is not shown every time it runs, it is likely to shown
up in some 'very busy' time-period.

--
View this message in context: http://drools.46999.n3.nabble.com/rules-users-java-lang-ArrayIndexOutOfBoundsException-thrown-in-mvel2-s-compiler-when-running-drools5-tp3805739p3811940.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list