Struts 2
  1. Struts 2
  2. WW-3746

Struts 2.3.1.1 OGNL crashes on WebSphere 7

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.1.1
    • Fix Version/s: 2.3.3
    • Component/s: None
    • Labels:
      None

      Description

      Using WebSphere Application Server 7.0.0.11 and upgrading from Struts 2.2.3.1 to 2.3.1.1 breaks the application.

      When enforcing the ognl version to 3.0.1, the application works fine. We can't figure out why using ognl 3.0.3 should break anything.

      Error messages include:

      Server-log:

      Caused by: Error on line 31, column 9 in template/simple/radiomap.ftl
      stack.findString(parameters.listValue) is undefined.
      It cannot be assigned to itemValue - Class: freemarker.core.Assignment
      File: Assignment.java
      Method: accept
      Line: 111 - freemarker/core/Assignment.java:111:-1
      at org.apache.struts2.components.UIBean.end(UIBean.java:515)
      at org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:42)

      Application log:

      [2012-01-18 13:17:34,992, ERROR, , Log4JLoggerFactory.java:96] - Template processing error: "Error on line 31, column 9 in template/simple/radiomap.ftl\nstack.findString(parameters.listValue) is undefined.\nIt cannot be assigned to itemValue"
      Error on line 31, column 9 in template/simple/radiomap.ftl
      stack.findString(parameters.listValue) is undefined.
      It cannot be assigned to itemValue
      The problematic instruction:
      ----------
      ==> assignment: itemValue=stack.findString(parameters.listValue) [on line 31, column 9 in template/simple/radiomap.ftl]
      in user-directive s.iterator [on line 23, column 1 in template/simple/radiomap.ftl]
      ----------

      Java backtrace for programmers:
      ----------
      freemarker.core.InvalidReferenceException: Error on line 31, column 9 in template/simple/radiomap.ftl
      stack.findString(parameters.listValue) is undefined.
      It cannot be assigned to itemValue
      at freemarker.core.Assignment.accept(Assignment.java:111)
      at freemarker.core.Environment.visit(Environment.java:221)
      at freemarker.core.IfBlock.accept(IfBlock.java:82)
      at freemarker.core.Environment.visit(Environment.java:221)
      at freemarker.core.MixedContent.accept(MixedContent.java:92)
      at freemarker.core.Environment.visit(Environment.java:221)
      at freemarker.core.Environment.visit(Environment.java:310)
      at freemarker.core.UnifiedCall.accept(UnifiedCall.java:130)
      at freemarker.core.Environment.visit(Environment.java:221)
      at freemarker.core.MixedContent.accept(MixedContent.java:92)
      at freemarker.core.Environment.visit(Environment.java:221)
      at freemarker.core.Environment.process(Environment.java:199)
      at freemarker.template.Template.process(Template.java:237)
      at org.apache.struts2.components.template.FreemarkerTemplateEngine.renderTemplate(FreemarkerTemplateEngine.java:157)
      at org.apache.struts2.components.UIBean.mergeTemplate(UIBean.java:559)
      at org.apache.struts2.components.UIBean.end(UIBean.java:513)
      at org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:42)
      at com.ibm._jsp.<our_JSP_file>._jspx_meth_s_radio_0(<our_JSP_file>.java:637)
      at com.ibm._jsp.<our_JSP_file>.access$52(<our_JSP_file>.java:608)
      at com.ibm._jsp.<our_JSP_file>$<our_JSP_file>Helper.invoke14(<our_JSP_file>.java:1852)
      at com.ibm._jsp.<our_JSP_file>$<our_JSP_file>Helper.invoke(<our_JSP_file>.java:2102)

      We think this is the radio-tag in question:

      <s:radio name="ourRadioName"
      list="#

      {'true':'Ja', 'false':'Nei'}

      ">
      <s:param name="break" value="true" />
      </s:radio>

        Issue Links

          Activity

          Peter Hemmen created issue -
          Hide
          Philip Luppens added a comment -

          Are you positive there's no classloading issue? Anything suspicious in the log file earlier during startup?

          Show
          Philip Luppens added a comment - Are you positive there's no classloading issue? Anything suspicious in the log file earlier during startup?
          Hide
          Peter Hemmen added a comment -

          I just rechecked the log files, and compared them when using both versions of ognl. I can't say that I see anything suspicious during startup. I agree that it does seem like a classloading issue, but I can't make sense of why it can be "fixed" by enforcing ognl 3.0.1.

          Show
          Peter Hemmen added a comment - I just rechecked the log files, and compared them when using both versions of ognl. I can't say that I see anything suspicious during startup. I agree that it does seem like a classloading issue, but I can't make sense of why it can be "fixed" by enforcing ognl 3.0.1.
          Hide
          Philip Luppens added a comment -

          My first idea would have been a duplicate xwork jar somewhere on the classpath, but if that's not the case, then it might be something more dark deep inside the OGNL/Freemarker integration.

          I cannot promise anything, but I'll try to have a look at another project that recently encountered a similarly strange error in a single Freemarker template after the upgrade to OGNL 3.0.3. If I find anything, I'll report back.

          Show
          Philip Luppens added a comment - My first idea would have been a duplicate xwork jar somewhere on the classpath, but if that's not the case, then it might be something more dark deep inside the OGNL/Freemarker integration. I cannot promise anything, but I'll try to have a look at another project that recently encountered a similarly strange error in a single Freemarker template after the upgrade to OGNL 3.0.3. If I find anything, I'll report back.
          Hide
          Kjetil Ødegaard added a comment -

          We've investigated this further, and it looks like this is the culprit:

          https://issues.apache.org/jira/browse/OGNL-44

          We only get this error with Java 2 Security enabled.

          Show
          Kjetil Ødegaard added a comment - We've investigated this further, and it looks like this is the culprit: https://issues.apache.org/jira/browse/OGNL-44 We only get this error with Java 2 Security enabled.
          Lukasz Lenart made changes -
          Field Original Value New Value
          Link This issue requires OGNL-44 [ OGNL-44 ]
          Hide
          Lukasz Lenart added a comment -

          I must postpone fixing this till OGNL will be release with the fix

          Show
          Lukasz Lenart added a comment - I must postpone fixing this till OGNL will be release with the fix
          Lukasz Lenart made changes -
          Fix Version/s 2.5 [ 12319158 ]
          Hide
          Lukasz Lenart added a comment -

          Or I can release a new version base on that [1] if someone could prepare a patch or lead me what should be changed.

          [1] https://github.com/jkuhnert/ognl

          Show
          Lukasz Lenart added a comment - Or I can release a new version base on that [1] if someone could prepare a patch or lead me what should be changed. [1] https://github.com/jkuhnert/ognl
          Hide
          Kjetil Ødegaard added a comment -

          This commit reverses the changes:

          https://github.com/kjetilod/ognl/commit/db0fcaffbb7f7992c01ee865d50252a305f30cb9

          Warning: This is only lightly tested, but it seems to fix the problem for us. The code is also identical with the previous version of this method.

          Show
          Kjetil Ødegaard added a comment - This commit reverses the changes: https://github.com/kjetilod/ognl/commit/db0fcaffbb7f7992c01ee865d50252a305f30cb9 Warning: This is only lightly tested, but it seems to fix the problem for us. The code is also identical with the previous version of this method.
          Lukasz Lenart made changes -
          Assignee Lukasz Lenart [ lukaszlenart ]
          Fix Version/s 2.3.2 [ 12319199 ]
          Fix Version/s 2.5 [ 12319158 ]
          Hide
          Lukasz Lenart added a comment - - edited

          Version 3.0.5 of OGNL is under way to Central Repo, next step is update S2.

          Show
          Lukasz Lenart added a comment - - edited Version 3.0.5 of OGNL is under way to Central Repo, next step is update S2.
          Hide
          Lukasz Lenart added a comment -

          Done, new OGNL 3.0.5 released, Struts 2 upgraded. Could you test the latest build ? Thanks in advance!

          Show
          Lukasz Lenart added a comment - Done, new OGNL 3.0.5 released, Struts 2 upgraded. Could you test the latest build ? Thanks in advance!
          Lukasz Lenart made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Hide
          Hudson added a comment -

          Integrated in Struts2 #446 (See https://builds.apache.org/job/Struts2/446/)
          WW-3746 Upgrades OGNL to version 3.0.5 to solve problem with running Struts 2 application within secured environment (Revision 1310686)

          Result = SUCCESS
          lukaszlenart :
          Files :

          • /struts/struts2/trunk/pom.xml
          Show
          Hudson added a comment - Integrated in Struts2 #446 (See https://builds.apache.org/job/Struts2/446/ ) WW-3746 Upgrades OGNL to version 3.0.5 to solve problem with running Struts 2 application within secured environment (Revision 1310686) Result = SUCCESS lukaszlenart : Files : /struts/struts2/trunk/pom.xml
          Lukasz Lenart made changes -
          Fix Version/s 2.3.3 [ 12320642 ]
          Fix Version/s 2.3.2 [ 12319199 ]
          Lukasz Lenart made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              Lukasz Lenart
              Reporter:
              Peter Hemmen
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development