MyFaces Tomahawk
  1. MyFaces Tomahawk
  2. TOMAHAWK-1329

javax.crypto.IllegalBlockSizeException with inputSuggestAjax

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.1.7-SNAPSHOT, 1.1.7, 1.1.8-SNAPSHOT
    • Fix Version/s: 1.1.8
    • Component/s: InputSuggestAjax
    • Labels:
      None

      Description

      When I use the current inputSuggestAjax from Tomahawk 1.1.7-SNAPSHOT I get the following stacktrace:

      12 sep 2008 15:16:26 ERROR (_ErrorPageWriter.java:460) - An exception occurred
      javax.faces.FacesException: javax.crypto.IllegalBlockSizeException: Input length must be multiple of 8 when decrypting with padded cipher
      at org.apache.myfaces.shared_impl.util.StateUtils.symmetric(StateUtils.java:373)
      at org.apache.myfaces.shared_impl.util.StateUtils.symmetric(StateUtils.java:411)
      at org.apache.myfaces.shared_impl.util.StateUtils.decrypt(StateUtils.java:291)
      at org.apache.myfaces.shared_impl.util.StateUtils.reconstruct(StateUtils.java:240)
      at org.apache.myfaces.renderkit.html.HtmlResponseStateManager.getSavedState(HtmlResponseStateManager.java:187)
      at org.apache.myfaces.renderkit.html.HtmlResponseStateManager.getState(HtmlResponseStateManager.java:139)
      at org.apache.myfaces.application.jsp.JspStateManagerImpl.restoreView(JspStateManagerImpl.java:306)
      at org.apache.myfaces.application.jsp.JspViewHandlerImpl.restoreView(JspViewHandlerImpl.java:515)
      at com.sun.facelets.FaceletViewHandler.restoreView(FaceletViewHandler.java:316)
      [...]
      Caused by: javax.crypto.IllegalBlockSizeException: Input length must be multiple of 8 when decrypting with padded cipher
      at com.sun.crypto.provider.SunJCE_h.b(DashoA12275)
      at com.sun.crypto.provider.SunJCE_h.b(DashoA12275)
      at com.sun.crypto.provider.DESCipher.engineDoFinal(DashoA12275)
      at javax.crypto.Cipher.doFinal(DashoA12275)
      at org.apache.myfaces.shared_impl.util.StateUtils.symmetric(StateUtils.java:369)
      ... 61 more
      12 sep 2008 15:16:26 WARN (DefaultAddResource.java:363) - MyFaces special javascript could not be retrieved from request-map.

      When I revert the following change in FacesIO.js:

      2008-06-16 15:01 lu4242

      • [r668179]
        core/src/main/resources/org/apache/myfaces/custom/dojoextensions/resource/FacesIO.js:
        TOMAHAWK-1157 tableSuggestAjax not render with trinidad

      the inputSuggestAjax works again as before.
      This is with MyFaces-1.2.4, Tomahawk/sandbox 1.1.7-SNAPSHOT and Facelets.

      As suggested by Cagatay Civici, adding this parameter to web.xml is a work-around:

      <context-param>
      <param-name>org.apache.myfaces.USE_ENCRYPTION</param-name>
      <param-value>false</param-value>
      </context-param>

      However, this needs a real solution.

        Activity

        Hide
        Leonardo Uribe added a comment -

        After checking this error the problem is when the ajax call to ask for suggested values is done, the value of javax.faces.ViewState send in the code of FacesIO.js needs to be encoded correctly.

        The solution is encode properly the value so when the state is restored, the correct value is given.

        Show
        Leonardo Uribe added a comment - After checking this error the problem is when the ajax call to ask for suggested values is done, the value of javax.faces.ViewState send in the code of FacesIO.js needs to be encoded correctly. The solution is encode properly the value so when the state is restored, the correct value is given.

          People

          • Assignee:
            Leonardo Uribe
            Reporter:
            Gertjan van Oosten
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development