[jboss-jira] [JBoss JIRA] (JBRULES-3377) drools modify command mvel exception
RH Bugzilla Integration (JIRA)
jira-events at lists.jboss.org
Fri Feb 3 10:04:51 EST 2012
[ https://issues.jboss.org/browse/JBRULES-3377?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
RH Bugzilla Integration updated JBRULES-3377:
---------------------------------------------
Bugzilla References: https://bugzilla.redhat.com/show_bug.cgi?id=769587
> drools modify command mvel exception
> ------------------------------------
>
> Key: JBRULES-3377
> URL: https://issues.jboss.org/browse/JBRULES-3377
> Project: Drools
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Reporter: Mario Fusco
> Assignee: Mario Fusco
>
> Following exception occurs when trying to execute modify command on stateful
> session:
> { with (this) {
> age = 30
> ,name = Frank
> ,id = 0
> ,likes = nobody
> } }
> Exception in thread "main" [Error: unable to resolve method:
> com.redhat.modifyreproducer.Person.Frank() [arglength=0]]
> [Near : {... ,name = Frank ....}]
> ^
> [Line: 5, Column: 1]
> at org.mvel2.PropertyAccessor.getMethod(PropertyAccessor.java:977)
> at org.mvel2.PropertyAccessor.getBeanProperty(PropertyAccessor.java:687)
> at org.mvel2.PropertyAccessor.getNormal(PropertyAccessor.java:202)
> at org.mvel2.PropertyAccessor.get(PropertyAccessor.java:171)
> at org.mvel2.PropertyAccessor.get(PropertyAccessor.java:151)
> at org.mvel2.ast.ASTNode.getReducedValue(ASTNode.java:185)
> at
> org.mvel2.MVELInterpretedRuntime.parseAndExecuteInterpreted(MVELInterpretedRuntime.java:106)
> at org.mvel2.MVELInterpretedRuntime.parse(MVELInterpretedRuntime.java:49)
> at org.mvel2.MVEL.eval(MVEL.java:408)
> at org.mvel2.util.ParseTools.parseWithExpressions(ParseTools.java:1591)
> at org.mvel2.ast.WithNode.getReducedValue(WithNode.java:75)
> at
> org.mvel2.MVELInterpretedRuntime.parseAndExecuteInterpreted(MVELInterpretedRuntime.java:106)
> at org.mvel2.MVELInterpretedRuntime.parse(MVELInterpretedRuntime.java:49)
> at org.mvel2.MVEL.eval(MVEL.java:109)
> at
> org.drools.command.runtime.rule.ModifyCommand.execute(ModifyCommand.java:79)
> at
> org.drools.impl.StatefulKnowledgeSessionImpl.execute(StatefulKnowledgeSessionImpl.java:798)
> at
> org.drools.impl.StatefulKnowledgeSessionImpl.execute(StatefulKnowledgeSessionImpl.java:781)
> at com.redhat.modifyreproducer.Main.test(Main.java:52)
> at com.redhat.modifyreproducer.Main.main(Main.java:30)
> ------------------------------------------------------------------------------
> First, fact is inserted into the session, next step is creating Modify command
> with setter list:
> Person p1 = new Person("John", "nobody", 25);
> session.execute(CommandFactory.newInsert(p1));
> FactHandle fh = session.getFactHandle(p1);
> Person p = new Person("Frank", "nobody", 30);
> List<Setter> setterList = new ArrayList<Setter>();
> setterList.add(CommandFactory.newSetter("age",
> String.valueOf(p.getAge())));
> setterList.add(CommandFactory.newSetter("name", p.getName()));
> setterList.add(CommandFactory.newSetter("likes", p.getLikes()));
> setterList.add(CommandFactory.newSetter("id",
> String.valueOf(p.getId())));
> session.execute(CommandFactory.newModify(fh, setterList));
> See an attachment for the details, just build as maven project and run.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list