Details
Description
When I call a static method with an expression as param, like this:
mvel.test.AStatic.process(value)
where value is a field of a given pojo, I receive the following exception
org.mvel.PropertyAccessException: unable to resolve property: failed to access property: <<mvel.test.AStatic.process(value)>> in: class mvel.test.PojoStatic
at org.mvel.PropertyAccessor.get(PropertyAccessor.java:182)
at org.mvel.PropertyAccessor.get(PropertyAccessor.java:131)
at org.mvel.ASTNode.getReducedValue(ASTNode.java:256)
at org.mvel.MVELInterpretedRuntime.parseAndExecuteInterpreted(MVELInterpretedRuntime.java:110)
at org.mvel.MVELInterpretedRuntime.parse(MVELInterpretedRuntime.java:58)
at org.mvel.MVEL.eval(MVEL.java:127)
at mvel.test.StaticMvelTest.testStaticWithExpressionParam(StaticMvelTest.java:25)
Caused by: org.mvel.PropertyAccessException: unable to resolve property: could not access property (mvel)
at org.mvel.PropertyAccessor.getBeanProperty(PropertyAccessor.java:442)
at org.mvel.PropertyAccessor.get(PropertyAccessor.java:156)
... 28 more
I've attached a testcase to reproduce it
Thanks in advance
German.-
The test-case you submitted is in error itself. In your class, AStatic, the method call is "Process" with an uppercase P. However, note in your testcase here:
... you are calling "process" with a lower case P. All method calls in MVEL (like Java) are case sensitive. If you correct the code accordingly, it passes fine.