commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Maurizio Cucchiara (Commented) (JIRA)" <>
Subject [jira] [Commented] (OGNL-46) Nullsafe method selection?
Date Sat, 14 Jan 2012 11:04:39 GMT


Maurizio Cucchiara commented on OGNL-46:

I bet that your week var is an integer and I guess it is something to do with struts type
conversion, after all to what would you implicitly convert a null object? it is a good candidate
for almost everything.
BTW I agree with you, if there is an int setter, there is no reason to look for a string setter.
I'll take a deeper look (as soon as I can) to understand if it is a struts or an ognl related
> Nullsafe method selection?
> --------------------------
>                 Key: OGNL-46
>                 URL:
>             Project: Commons OGNL
>          Issue Type: Bug
>            Reporter: Christian Grobmeier
>            Priority: Minor
> For some reason it seems that with Struts 2.3.1 sending a null value does lead to confusion
in OGNL. For example:
> setToken(String token){}
> should be set by OGNL. It works, if String != null. If String is null, OGNL claims this
method does not exist for unknown reason. Probably this is somehow related to Struts, but
feeling says solution can be found in OGNL.
> Workaround is not to send null ;-)
> 2012-01-13 15:58:29,830 WARN  [] : Error setting expression 'week'
with value '[Ljava.lang.String;@6e895972'
> ognl.MethodFailedException: Method "setWeek" failed for object
> 	at ognl.OgnlRuntime.callAppropriateMethod(
> 	at ognl.OgnlRuntime.setMethodValue(
> 	at ognl.ObjectPropertyAccessor.setPossibleProperty(
> 	at ognl.ObjectPropertyAccessor.setProperty(
> 	at com.opensymphony.xwork2.ognl.accessor.ObjectAccessor.setProperty(
> 	at ognl.OgnlRuntime.setProperty(
> 	at com.opensymphony.xwork2.ognl.accessor.CompoundRootAccessor.setProperty(
> 	at ognl.OgnlRuntime.setProperty(
> 	at ognl.ASTProperty.setValueBody(
> 	at ognl.SimpleNode.evaluateSetValueBody(
> 	at ognl.SimpleNode.setValue(
> 	at ognl.Ognl.setValue(
> 	at com.opensymphony.xwork2.ognl.OgnlUtil.setValue(
> 	at com.opensymphony.xwork2.ognl.OgnlValueStack.trySetValue(
> 	at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(
> 	at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(
> 	at com.opensymphony.xwork2.interceptor.ParametersInterceptor.setParameters(
> 	at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(
> 	at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message