[ http://jira.jboss.com/jira/browse/JBRULES-1461?page=all ]
Godmar Back closed JBRULES-1461.
--------------------------------
Resolution: Cannot Reproduce Bug
Issue occurred with MVEL 1.2beta16.
Please fix http://jira.jboss.com/jira/browse/JBRULES-1466 instead.
> 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