[jboss-jira] [JBoss JIRA] Commented: (JBRULES-1438) FactTemplate Property Access leads to RuleBuilder Exception
Mark Proctor (JIRA)
jira-events at lists.jboss.org
Thu May 1 18:44:18 EDT 2008
[ http://jira.jboss.com/jira/browse/JBRULES-1438?page=comments#action_12411519 ]
Mark Proctor commented on JBRULES-1438:
---------------------------------------
I'm just looking into your drl at the momen, will get back to you.
On the second error:
System.out.println("Found: " + $s.InstrumentName);
That isn't allowed, this is one of the reasons why we haven't made fact templates public knowledge. Java or MVEL see fact templates as anything special, so you have to just treat it like a normal pojo of the FactTemplate interface:
s.getValue( "InstrumentName" )
> FactTemplate Property Access leads to RuleBuilder Exception
> -----------------------------------------------------------
>
> Key: JBRULES-1438
> URL: http://jira.jboss.com/jira/browse/JBRULES-1438
> Project: JBoss Drools
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Drl Parser/Builder
> Affects Versions: 4.0.4
> Reporter: greywind
> Attachments: EntityTest.drl
>
>
> The only thing I do is to add the attached drl to a Package and do get the following exception:
> Exception in thread "main" org.mvel.CompileException: problem encountered at node [19] 5{1012,1042}: unable to resolve property: could not access property
> at org.mvel.TemplateInterpreter.execute(TemplateInterpreter.java:554)
> at org.mvel.TemplateInterpreter.parse(TemplateInterpreter.java:338)
> at org.drools.rule.builder.dialect.java.AbstractJavaBuilder.generatTemplates(AbstractJavaBuilder.java:120)
> at org.drools.rule.builder.dialect.java.JavaConsequenceBuilder.build(JavaConsequenceBuilder.java:118)
> at org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:67)
> at org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:446)
> at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:304)
> at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:167)
> at org.drools.entity.EntityTest.main(EntityTest.java:48)
> Caused by: org.mvel.PropertyAccessException: unable to resolve property: could not access property
> at org.mvel.PropertyAccessor.get(PropertyAccessor.java:170)
> at org.mvel.PropertyAccessor.get(PropertyAccessor.java:128)
> at org.mvel.ASTNode.getReducedValue(ASTNode.java:247)
> at org.mvel.ast.PropertyASTNode.getReducedValue(PropertyASTNode.java:36)
> at org.mvel.MVELInterpretedRuntime.parseAndExecuteInterpreted(MVELInterpretedRuntime.java:115)
> at org.mvel.MVELInterpretedRuntime.parse(MVELInterpretedRuntime.java:63)
> at org.mvel.TemplateInterpreter.execute(TemplateInterpreter.java:409)
> ... 8 more
> Caused by: java.lang.reflect.InvocationTargetException
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at org.mvel.PropertyAccessor.getBeanProperty(PropertyAccessor.java:419)
> at org.mvel.PropertyAccessor.get(PropertyAccessor.java:153)
> ... 14 more
> Caused by: org.drools.RuntimeDroolsException: This is a bug. Please report to development team: org.drools.facttemplates.FactTemplateFieldExtractor.getValue(java.lang.Object)
> at org.drools.facttemplates.FactTemplateFieldExtractor.getNativeReadMethod(FactTemplateFieldExtractor.java:82)
> at org.drools.rule.Declaration.getNativeReadMethod(Declaration.java:291)
> ... 20 more
> Caused by: java.lang.NoSuchMethodException: org.drools.facttemplates.FactTemplateFieldExtractor.getValue(java.lang.Object)
> at java.lang.Class.getDeclaredMethod(Class.java:1909)
> at org.drools.facttemplates.FactTemplateFieldExtractor.getNativeReadMethod(FactTemplateFieldExtractor.java:79)
> ... 21 more
> When I select dialect 'mvel' it does work however!
--
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