[rules-users] issues with parser when using MVEL dialect

Godmar Back godmar at gmail.com
Wed Feb 13 10:28:52 EST 2008


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



More information about the rules-users mailing list