You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Greg Lindholm <gr...@gmail.com> on 2009/07/31 15:19:12 UTC

Re: [S2] OgnlValueStack Error setting expression warnings after upgrade from struts 2 to struts 2.1.7

I just change the logging level.

log4j.properties:
# Struts OgnlUtil issues unimportant warnings
log4j.logger.com.opensymphony.xwork2.util.OgnlUtil=error
log4j.logger.com.opensymphony.xwork2.ognl.OgnlValueStack=error


On Fri, Jul 31, 2009 at 8:48 AM, Peter Phillips <
petergphillips@googlemail.com> wrote:

> I recently upgraded from struts 2.0 to 2.1.7 and noticed that we are
> now getting lots of warnings in the logs:
>
> 12:31:53,283 WARN  [OgnlValueStack] Error setting expression
> 'button.save' with value '[Ljava.lang.String;@1683e9f'
> ognl.OgnlException: target is null for setProperty(null, "save",
> [Ljava.lang.String;@1683e9f)
>        at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1651)
>        at ognl.ASTProperty.setValueBody(ASTProperty.java:101)
>        at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
>        at ognl.SimpleNode.setValue(SimpleNode.java:246)
>        at ognl.ASTChain.setValueBody(ASTChain.java:172)
>        at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
>        at ognl.SimpleNode.setValue(SimpleNode.java:246)
>        at ognl.Ognl.setValue(Ognl.java:476)
>        at com.opensymphony.xwork2.ognl.OgnlUtil.setValue(OgnlUtil.java:192)
>        at
> com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:161)
>
> In our case the jsp has a submit button - <s:submit key="button.save" />.
>
> Our action doesn't have a button.save property, I could add one to
> suppress the warning but it doesn't feel right to add code to an
> action to prevent a warning in the logs.  Alternatively I guess I
> could change the log4j settings so that OgnlValueStack was set to
> ERROR, but this would stop other warnings that I might actually be
> interested in.
>
> XW-613 changed the logging levels for the class from debug to warning
> in a few places.  However reading the bug report by Brian Pontarelli
> in XW-613 his issue seems to be the lack of warning logging when
> exceptions are caught - which in my mind is more in the method
> logLookupFailure (lines 353-359).  I agree that this is an exception
> that the user should be warned about, whereas at present it is only a
> debug (if devMode is false).
>
> How are other people getting round the problem with submit buttons
> causing warnings in the logs?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>