1

I am trying to turn off the following warning message

OgnlValueStac W com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn Error setting expression 'checkboxidentifyer' with value '[Ljava.lang.String;@518b518b'

I have tried putting the following in my log4j.xml file

<logger name="log4j.logger.org.apache.struts2" >
    <level value="ERROR" />
    <appender-ref ref="console" />
</logger>
<logger name="log4j.logger.com.opensymphony" >
  <level value="ERROR" />
  <appender-ref ref="console" />
</logger>
<logger name="ognl.OgnlException" >
  <level value="ERROR" />
     <appender-ref ref="console" />
</logger>
<logger name="com.opensymphony.xwork2.util.logging.commons.CommonsLogger" >
  <level value="ERROR" />
  <appender-ref ref="console" />
</logger>
<logger name="ognl.OgnlRuntime" >
  <level value="ERROR" />
  <appender-ref ref="console" />
</logger>

I have also tried adding

<constant name="struts.devMode" value="false" />

to my struts.xml file. Also I have tried adding the following to the interceptor-stack section of the struts.xml file

<interceptor-ref name="defaultStack">
    <param name="excludeParams">.*?checkbox.*</param>
</interceptor-ref>

My questions are:

  1. Did I do a miss configuration?
  2. How do you disable the warnings.

2 Answers 2

1

The excludeParams is a property of the params interceptor and should be referenced like this

<interceptor-ref name="defaultStack">
    <param name="params.excludeParams">.*?checkbox.*</param>
</interceptor-ref>

Note, if you use interceptor-ref tag on the action then it overrides the default interceptor stack and applicable only to this action config. For common usage consider creating a custom interceptor stack and make it default for any action configuration.

You can set a logging level for interceptors and OGNL. Using log4j.properties

log4j.logger.com.opensymphony.xwork2.interceptor=ERROR
log4j.logger.com.opensymphony.xwork2.ognl=ERROR
6
  • I tried the change to the param name, and I also tried adding the new log4j.properties (we did not have one of those since we are using the xml configuration instead) and still I am getting the warning message. And yes we are over riding the defualt interceptor-stack.
    – mpop
    Aug 29, 2014 at 15:58
  • Let me also note I have tried adding those identifers to the log4j.xml file too, adding <logger name="log4j.logger.com.opensymphony.xwork2.interceptor" > and <logger name="log4j.logger.com.opensymphony.xwork2.ognl" > to it, using the same body for the logger tag as I used in the question above.
    – mpop
    Aug 29, 2014 at 16:08
  • Also add <level value="ERROR">.
    – Roman C
    Aug 29, 2014 at 17:29
  • I do have that in the file, both entries follow this formula <logger name="log4j.logger.com.opensymphony.xwork2.ognl" > <level value="ERROR" /> <appender-ref ref="console" /> </logger>
    – mpop
    Aug 29, 2014 at 17:30
  • playing off of your anser about the location of the excludeParams, I moved it out of the <interceptor-ref name="defaultStack"> section and into the <interceptor-ref name="params"> and that is what finally fixed the issue.
    – mpop
    Aug 29, 2014 at 17:37
0

I finnaly sovled the error, while I had (as seen in the question above the param in the defaultStack interceptor-ref, when I moved the param to the interceptor-ref name params it removed the error

<interceptor-stack name="new_default_stack">
  <interceptor-ref name="params">
  <param name="paramNameMaxLength">250</param>
  <param name="excludeParams">.*?checkbox.*</param>
  </interceptor-ref>
  <interceptor-ref name="timeActions"/>
  <interceptor-ref name="defaultStack">

  </interceptor-ref>
  <interceptor-ref name="userProfile"/>
  <interceptor-ref name="valueStackManipulator"/>
  <interceptor-ref name="actionHistoryRecorder"/>
  <interceptor-ref name="cachingHeadersInterceptor"/>
</interceptor-stack>

it was the location of the excludeParams that needed to be changed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.