]
RH Bugzilla Integration commented on JBRULES-3377:
--------------------------------------------------
JBoss JIRA Server <jira-update(a)redhat.com> made a comment on [bug
]
Mario Fusco <mario.fusco(a)gmail.com> made a comment on jira JBRULES-3377
Indeed I flagged 5.4.0.CR1 as the fix version for this issue, not the 5.3
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
Fix For: 5.4.0.CR1
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: