[jboss-jira] [JBoss JIRA] Commented: (JBRULES-1461) comment leads to org.mvel.PropertyAccessException

Godmar Back (JIRA) jira-events at lists.jboss.org
Sun Feb 10 15:11:03 EST 2008


    [ http://jira.jboss.com/jira/browse/JBRULES-1461?page=comments#action_12399043 ] 
            
Godmar Back commented on JBRULES-1461:
--------------------------------------

Here's another test:

package test;

dialect "mvel"

rule "Rule #1"
when
then
    System.out.println("now computing 1+1...");
    Integer two = new Integer(2);
    System.out.println(two);
end
---
it works if I 
- use dialect "java" instead of "mvel"
- comment out the first System.out with a single-line comment, as in 
  // System.out.println("now computing 1+1...");

it also breaks if use a multi-line comment, as in:
  /* System.out.println("now computing 1+1..."); */

I'm using the downloaded 4.0.4 with the mvel14-1.2.21.jar, btw, and the antlr-runtime-3.0.jar included in that tarball. 


> comment leads to org.mvel.PropertyAccessException
> -------------------------------------------------
>
>                 Key: JBRULES-1461
>                 URL: http://jira.jboss.com/jira/browse/JBRULES-1461
>             Project: JBoss Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 4.0.4
>            Reporter: Godmar Back
>
> I'm still fighting with Drools's parser.
> This code:
> package test;
> import java.util.ArrayList;
> import java.util.HashMap;
> dialect "mvel"
> rule "Rule #1"
> when
> then
>     /* a comment */
>     System.out.println("hello world");
> end
> produces:
> 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)
>         at org.libx.autodetect.DroolsDriver$Host.fireAllRules(DroolsDriver.java:63)
>         at org.libx.autodetect.DroolsDriver.main(DroolsDriver.java:135)
> Caused by: org.mvel.PropertyAccessException: unable to resolve property: ;
>         at org.mvel.optimizers.impl.refl.ReflectiveAccessorOptimizer.getBeanProperty(ReflectiveAccessorOptimizer.java:373)
>         at org.mvel.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:254)
>         ... 12 more
> but this works:
> package test;
> import java.util.ArrayList;
> import java.util.HashMap;
> dialect "mvel"
> rule "Rule #1"
> when
> then
>     // a single-line comment
>     System.out.println("hello world");
> end
> It makes it *very* difficult to use Drools if one has to work around such silly bugs.
> As a matter of fact, Drools does not seem to handle the presence of multi-line comments in a RHS well.
> (Even though the documentation says they're ok:
> http://downloads.jboss.com/drools/docs/4.0.4.17825.GA/html_single/index.html#d0e2807
> Not sure what is going on. I looked at:
> http://viewvc.jboss.org/cgi-bin/viewvc.cgi/labs/labs/jbossrules/branches/4.0.x/drools-compiler/src/main/resources/org/drools/lang/DRL.g?view=markup
> which appears to be correct and sends multiline comments to ANTLR's hidden channel.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list