[
https://issues.apache.org/jira/browse/WW-4025?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13613773#comment-13613773
]
Christian Wolfgang Stone commented on WW-4025:
----------------------------------------------
Thanks for the quick fix! Even greater thanks for implementing the logging fix
for Freemarker!
> NullPointerException in OgnlTextParser.evaluate().
> --------------------------------------------------
>
> Key: WW-4025
> URL: https://issues.apache.org/jira/browse/WW-4025
> Project: Struts 2
> Issue Type: Bug
> Components: Core Interceptors
> Affects Versions: 2.3.13
> Reporter: Christian Wolfgang Stone
> Assignee: Lukasz Lenart
> Priority: Blocker
> Fix For: 2.3.14
>
>
> In the latest code, lukaszlenart refactored some code. Using a recent build,
> I get the following error (relevant code follows).
> {noformat}
> java.lang.NullPointerException
> at
> com.opensymphony.xwork2.util.TextParseUtil$1.evaluate(TextParseUtil.java:161)
> at
> com.opensymphony.xwork2.util.OgnlTextParser.evaluate(OgnlTextParser.java:50)
> at
> com.opensymphony.xwork2.util.TextParseUtil.translateVariables(TextParseUtil.java:172)
> at
> com.opensymphony.xwork2.util.TextParseUtil.translateVariables(TextParseUtil.java:127)
> at
> com.opensymphony.xwork2.util.TextParseUtil.translateVariables(TextParseUtil.java:71)
> at
> org.apache.struts2.dispatcher.StrutsResultSupport.conditionalParse(StrutsResultSupport.java:198)
> at
> org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:185)
> at
> org.apache.struts2.dispatcher.ServletRedirectResult.execute(ServletRedirectResult.java:161)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:371)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:275)
> at
> org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256)
> {noformat}
> The relevant source code is:
> {code}
> + ParsedValueEvaluator ognlEval = new ParsedValueEvaluator() {
> + public Object evaluate(String parsedValue) {
> + Object o = stack.findValue(parsedValue, asType);
> + if (evaluator != null) {
> + o = evaluator.evaluate(o.toString());
> }
> + return o;
> }
> - }
> {code}
> Appears as if there is an assumption that the stack.findValue() will always
> return a non-null value.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira