On closer examination, it was my bad. I discovered a mvel.jar in a
directory I had in my java.exts.dir that came bundled with ZK. This
mvel.jar has version 1.2beta16, and it's responsible for these
failures, which don't occur with 1.2.21 or 1.2.22.
Since I'm not the first to be tripped off by this (*), let me suggest
this: when you load MVEL, please read org.mvel.MVEL.VERSION and
org.mvel.MVEL.VERSION_SUB and bail if they're not compatible.
- Godmar
(*)
http://lists.jboss.org/pipermail/rules-users/2008-February/004707.html
On Feb 13, 2008 10:28 AM, Godmar Back <godmar(a)gmail.com> wrote:
Hi,
I've recently upgraded to Drools 4.0.4 with mvel14-1.2.21.jar, and I'm
having severe issues with its parser.
For instance, this simple .drl file:
--
package test;
rule "Rule #1"
dialect "mvel"
when
then
/* a single-line comment */
System.out.println("hello world");
end
--
results in:
org.mvel.PropertyAccessException: unable to resolve property: ;
at
org.mvel.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:285)
at
org.mvel.optimizers.impl.refl.ReflectiveAccessorOptimizer.optimizeAccessor(ReflectiveAccessorOptimizer.java:107)
at org.mvel.ASTNode.getReducedValueAccelerated(ASTNode.java:185)
at org.mvel.MVELRuntime.execute(MVELRuntime.java:88)
at org.mvel.CompiledExpression.getValue(CompiledExpression.java:107)
at org.mvel.MVEL.executeExpression(MVEL.java:223)
at org.drools.base.mvel.MVELConsequence.evaluate(MVELConsequence.java:47)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:550)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:514)
at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:471)
at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:433)
--
Switching to dialect "java," or removing the /* single-line comment
*/, helps. So does replacing the comment with a // style comment.
There are many more weirdnesses I'm encountering (I've filed a number
of bugs already), but I'm wondering if something else isn't amiss
here. I also tried mvel16-1.2.22.jar, same effect. On the other hand,
running just the RHS in mvelsh works just fine.
In this context, I'd like to voice the wish that Drools include a
command-line driver that can load and execute .drl files for testing.
- Godmar