Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-4318

Logging message when OgnlValueStack fail to set expression is cryptic most of the time

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.3.16.1
    • Fix Version/s: 2.3.20
    • Component/s: Value Stack
    • Labels:
    • Flags:
      Patch

      Description

      Most of the time, the logging message printed by OgnlValueStack class is useless because it doesn't show the value that causes the problem.

      Exemple log:

      2014/03/20 02:23:28 WARN (CommonsLogger.java:64) warn Error setting expression 'myIntField' with value '[Ljava.lang.String;@55227e4a'
      ognl.MethodFailedException: Method "setMyIntField" failed for object fr.my.company.MyAction@df39b8b4 [java.lang.NoSuchMethodException: fr.my.company.MyAction@df39b8b4.setMyIntField([Ljava.lang.String;)]

      I can't find the reason because toString() is on a array show '[Ljava.lang.String;@55227e4a' but i would like to see the actual value in the array.

      The exact same problem is fixed right in the method above the buggy one: the trivial patch is included.

        Attachments

        1. WW-4318.patch
          0.9 kB
          Brendan Le Ny

          Activity

            People

            • Assignee:
              lukaszlenart Lukasz Lenart
              Reporter:
              bleny Brendan Le Ny
            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 5m
                5m
                Remaining:
                Remaining Estimate - 5m
                5m
                Logged:
                Time Spent - Not Specified
                Not Specified