I am no drools expert but I am working a few mvel bugs in free time. I
am still sorting through the code.
I will try to work in test case but I don't know where
the line
Helper.containsAny(offerSubject, ((Set)colMap.get("_set_212"))) is
coming from.
This isn't in one of your rules is it?
The index out of bounds is from the mvel code.
Pretty sure one of the project maintainers will give us more to go with.
2012/3/6 Miles Wen <miles.wy.1(a)gmail.com>:
hi all,
the exception below is usually thrown when the system is busy(usually 9-10
am everyday);
The rules runs perfectly when unit test or any other time when the system is
not very busy(like 22:00 - 4:00 every day);
Our system processes 13000000 pieces of data each day, with
4-5 java.lang.ArrayIndexOutOfBoundsException thrown on average.It's not very
often but doubtful.
The logs are shown below:
2012-03-07 10:10:33,683 [] ERROR ruleservice.RuleServiceImpl - Error
occurred while invoking business filter!
java.lang.reflect.InvocationTargetException
at
com.alibaba.china.avatar.offer.rulematch.OfferMatchFilter$$FastClassByCGLIB$$18f6f037.invoke(<generated>)
at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
at
com.alibaba.china.ruleservice.RuleServiceImpl.bindParamAndInvoke(RuleServiceImpl.java:264)
at
com.alibaba.china.ruleservice.RuleServiceImpl.match(RuleServiceImpl.java:82)
at sun.reflect.GeneratedMethodAccessor248.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at
com.alibaba.china.avatar.interceptor.KeyDataLoggingAfterThrowingInterceptor.invoke(KeyDataLoggingAfterThrowingInterceptor.java:24)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at
com.alibaba.dragoon.patrol.spring.DragoonMethodInterceptor.invoke(DragoonMethodInterceptor.java:106)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy16.match(Unknown Source)
at
com.alibaba.china.avatar.offer.decode.OfferMessageAction.run(OfferMessageAction.java:39)
at
com.alibaba.china.rialto.core.module.DefaultActionModule.doWork(DefaultActionModule.java:375)
at
com.alibaba.china.rialto.core.module.DefaultActionModule.runModule(DefaultActionModule.java:252)
at
com.alibaba.china.rialto.core.module.ModuleRunner.run(ModuleRunner.java:31)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.drools.RuntimeDroolsException: Exception executing predicate
Helper.containsAny(offerSubject, ((Set)colMap.get("_set_212")))
at
org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:298)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:130)
at
org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:458)
at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:386)
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:215)
at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:244)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:330)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:291)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:886)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:845)
at
org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:255)
at
com.alibaba.china.ruleservice.session.impl.drools5.TransientDrools5Session.insertFact(TransientDrools5Session.java:100)
at
com.alibaba.china.avatar.offer.rulematch.OfferMatchFilter.doFilter(OfferMatchFilter.java:57)
... 23 more
Caused by: [Error: unexpected end of statement]
[Near : {... Helper.containsAny(offerSubject, ((Set)colMap.get("_set_212")))
....}]
^
[Line: 1, Column: 39]
at org.mvel2.compiler.AbstractParser.nextToken(AbstractParser.java:1215)
at
org.mvel2.compiler.ExpressionCompiler._compile(ExpressionCompiler.java:128)
at org.mvel2.util.ParseTools.subCompileExpression(ParseTools.java:2090)
at org.mvel2.ast.Substatement.<init>(Substatement.java:37)
at org.mvel2.compiler.AbstractParser.nextToken(AbstractParser.java:1062)
at
org.mvel2.compiler.ExpressionCompiler._compile(ExpressionCompiler.java:128)
at org.mvel2.util.ParseTools.subCompileExpression(ParseTools.java:2079)
at
org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.getMethod(ReflectiveAccessorOptimizer.java:953)
at
org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:375)
at
org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.optimizeAccessor(ReflectiveAccessorOptimizer.java:141)
at org.mvel2.ast.ASTNode.optimize(ASTNode.java:157)
at org.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:113)
at org.mvel2.MVELRuntime.execute(MVELRuntime.java:87)
at
org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:122)
at
org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:115)
at org.mvel2.MVEL.executeExpression(MVEL.java:930)
at
org.drools.base.mvel.MVELPredicateExpression.evaluate(MVELPredicateExpression.java:100)
at
org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:291)
... 35 more
Caused by: java.lang.ArrayIndexOutOfBoundsException
I looks like there's some issue in mvel2's parser.The problem occurs when
dynamic compiling mvel2 code.
And every ArrayIndexOutOfBoundsException is thrown around here:
'Helper.containsAny(offerSubject, ((Set)colMap.get("_set_212")))'
.This is
a custom static function call which implements come sort of operation not
supported by drools5.
Is this a bug about mvel2?Or any one encountered this problem also? How
could I avoid it?
Thnaks!
--
Regards.
Miles. Wen
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users