Wicket
  1. Wicket
  2. WICKET-4755

"'NEW VALUE' is not a valid Serializable" error during ajax form submission

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.8
    • Fix Version/s: 6.1.0
    • Component/s: None
    • Labels:
      None

      Description

      I attached a quickstart with a test in TestHomePage#formSubmitsSuccessfully.

      The test throws "'NEW VALUE' is not a valid Serializable" error when "NEW VALUE" string in "value" textField is submitted as a part of myForm ajax submission.

      The problem is that a call to Objects#convertValue(nonNullNonArrayValue, Object.class) will always return null if nonNullNonArrayValue is a value that is not null and not an array! Shouldn't it always return the first parameter when the second parameter is Object.class?

      Sven on Wicket forum suggested to fix this as by adding another if-statement in Objects#convertValue() if (toType.isInstance(value))

      { result = toType.cast(value); }

      See the following forum thread for more information http://apache-wicket.1842946.n4.nabble.com/Issues-with-default-type-conversion-in-1-5-td4651857.html

        Activity

        Sven Meier made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Sven Meier [ svenmeier ]
        Fix Version/s 6.1.0 [ 12322957 ]
        Resolution Fixed [ 1 ]
        Alec Swan made changes -
        Field Original Value New Value
        Description I attached a quickstart with a test in TestHomePage#formSubmitsSuccessfully.

        The test throws "'NEW VALUE' is not a valid Serializable" error when
        "NEW VALUE" string in "value" textField is submitted as a part of
        myForm ajax submission.

        The problem is that a call to Objects#convertValue(nonNullNonArrayValue, Object.class) will always return null if nonNullNonArrayValue is a value that is not null and not an array! Shouldn't it always return the first parameter when the second parameter is Object.class?

        Sven on Wicket forum suggested to fix this as by adding another if-statement in Objects#convertValue() if (toType.isInstance(value)) {
          result = toType.cast(value);
        }

        See the following forum thread for more information http://apache-wicket.1842946.n4.nabble.com/Issues-with-default-type-conversion-in-1-5-td4651857.html
        I attached a quickstart with a test in TestHomePage#formSubmitsSuccessfully.

        The test throws "'NEW VALUE' is not a valid Serializable" error when "NEW VALUE" string in "value" textField is submitted as a part of myForm ajax submission.

        The problem is that a call to Objects#convertValue(nonNullNonArrayValue, Object.class) will always return null if nonNullNonArrayValue is a value that is not null and not an array! Shouldn't it always return the first parameter when the second parameter is Object.class?

        Sven on Wicket forum suggested to fix this as by adding another if-statement in Objects#convertValue() if (toType.isInstance(value)) {
          result = toType.cast(value);
        }

        See the following forum thread for more information http://apache-wicket.1842946.n4.nabble.com/Issues-with-default-type-conversion-in-1-5-td4651857.html
        Alec Swan created issue -

          People

          • Assignee:
            Sven Meier
            Reporter:
            Alec Swan
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development