Wolfgang,<br><br>in the end I found that this issue and the one you reported last week were not related. <br>Anyway I fixed both, but as usual the fixes will be available when I'll deploy the next mvel release.<br><br>
Thanks again for your help,<br>Mario<br><br><div class="gmail_quote">On Tue, Jan 22, 2013 at 12:24 PM, Wolfgang Laun <span dir="ltr"><<a href="mailto:wolfgang.laun@gmail.com" target="_blank">wolfgang.laun@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Below is a self-contained DRL which, when run with 5.5.0, throws an<br>
exception "cannot invoke method asList". Remarkably, this only happens<br>
when a second Project fact is inserted. (Haven't I heard this before?)<br>
<br>
-W<br>
<br>
import java.util.List;<br>
import java.util.Arrays;<br>
import java.util.ArrayList;<br>
<br>
declare Project<br>
@typesafe (false)<br>
list1 : List<br>
list2 : List<br>
end<br>
<br>
rule kickoff<br>
salience 999999<br>
when<br>
then<br>
insert( new Project() );<br>
insert( new Project() ); // necessary to trigger the exception<br>
end<br>
<br>
rule " Config rule "<br>
dialect "mvel"<br>
no-loop true<br>
when<br>
P : Project()<br>
then<br>
modify(P) {<br>
list1 = Arrays.asList(10, 15, 20, 25),<br>
list2 = Arrays.asList(11, 2, 3, 4, 5, 10, 9, 8, 7)<br>
};<br>
end<br>
<br>
Exception in thread "main" Exception executing consequence for rule "<br>
Config rule " in express: java.lang.RuntimeException: cannot construct<br>
object<br>
at org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)<br>
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1297)<br>
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:1221)<br>
at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1456)<br>
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:710)<br>
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:674)<br>
at org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:230)<br>
at express.Main.execute(Main.java:77)<br>
at express.Main.main(Main.java:110)<br>
Caused by: java.lang.RuntimeException: cannot construct object<br>
at org.mvel2.optimizers.impl.refl.nodes.ConstructorAccessor.getValue(ConstructorAccessor.java:63)<br>
at org.mvel2.ast.NewObjectNode.getReducedValueAccelerated(NewObjectNode.java:233)<br>
at org.mvel2.compiler.ExecutableAccessor.getValue(ExecutableAccessor.java:42)<br>
at org.mvel2.ast.WithNode$ParmValuePair.eval(WithNode.java:281)<br>
at org.mvel2.ast.WithNode.getReducedValueAccelerated(WithNode.java:67)<br>
at org.mvel2.ast.InterceptorWrapper.getReducedValueAccelerated(InterceptorWrapper.java:40)<br>
at org.mvel2.MVELRuntime.execute(MVELRuntime.java:85)<br>
at org.mvel2.compiler.CompiledExpression.getDirectValue(CompiledExpression.java:123)<br>
at org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:119)<br>
at org.mvel2.MVEL.executeExpression(MVEL.java:930)<br>
at org.drools.base.mvel.MVELConsequence.evaluate(MVELConsequence.java:104)<br>
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1287)<br>
... 7 more<br>
Caused by: java.lang.RuntimeException: cannot invoke method: asList<br>
at org.mvel2.optimizers.impl.refl.nodes.MethodAccessor.getValue(MethodAccessor.java:63)<br>
at org.mvel2.optimizers.impl.refl.nodes.VariableAccessor.getValue(VariableAccessor.java:37)<br>
at org.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:108)<br>
at org.mvel2.compiler.ExecutableAccessor.getValue(ExecutableAccessor.java:42)<br>
at org.mvel2.optimizers.impl.refl.nodes.ConstructorAccessor.executeAll(ConstructorAccessor.java:76)<br>
at org.mvel2.optimizers.impl.refl.nodes.ConstructorAccessor.getValue(ConstructorAccessor.java:43)<br>
... 18 more<br>
Caused by: java.lang.ArrayIndexOutOfBoundsException: 4<br>
at org.mvel2.optimizers.impl.refl.nodes.MethodAccessor.executeAll(MethodAccessor.java:149)<br>
at org.mvel2.optimizers.impl.refl.nodes.MethodAccessor.getValue(MethodAccessor.java:48)<br>
... 23 more<br>
_______________________________________________<br>
rules-dev mailing list<br>
<a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
</blockquote></div><br>