MyFaces Core
  1. MyFaces Core
  2. MYFACES-2478

BadPaddingException: Given final block not properly padded

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 2.0.0-alpha
    • Fix Version/s: None
    • Component/s: JSR-314
    • Labels:
      None

      Description

      Hi running Myfaces Revision 897280 sometimes swallows the following exception

      please note that I'm running with facelets-1.1.15B1 on jetty-6.1.22 and have server side state saving turned on.

      javax.faces.FacesException: javax.crypto.BadPaddingException: Given final block not properly padded
      at org.apache.myfaces.context.ExceptionHandlerImpl.wrap(ExceptionHandlerImpl.java:241)
      at org.apache.myfaces.context.ExceptionHandlerImpl.handle(ExceptionHandlerImpl.java:156)
      at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:157)
      at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:88)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:189)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
      at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
      at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
      at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
      at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
      at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
      at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
      at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
      at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
      at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
      at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
      at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
      at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      at org.mortbay.jetty.Server.handle(Server.java:326)
      at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
      at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)
      at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755)
      at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
      at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
      at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
      at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
      Caused by: javax.crypto.BadPaddingException: Given final block not properly padded
      at com.sun.crypto.provider.SunJCE_f.b(DashoA13*..)
      at com.sun.crypto.provider.SunJCE_f.b(DashoA13*..)
      at com.sun.crypto.provider.DESCipher.engineDoFinal(DashoA13*..)
      at javax.crypto.Cipher.doFinal(DashoA13*..)
      at org.apache.myfaces.shared_impl.util.StateUtils.symmetric(StateUtils.java:471)
      at org.apache.myfaces.shared_impl.util.StateUtils.symmetric(StateUtils.java:513)
      at org.apache.myfaces.shared_impl.util.StateUtils.decrypt(StateUtils.java:313)
      at org.apache.myfaces.shared_impl.util.StateUtils.reconstruct(StateUtils.java:262)
      at org.apache.myfaces.renderkit.html.HtmlResponseStateManager.getSavedState(HtmlResponseStateManager.java:213)
      at org.apache.myfaces.renderkit.html.HtmlResponseStateManager.getState(HtmlResponseStateManager.java:160)
      at org.apache.myfaces.application.jsp.JspStateManagerImpl.restoreView(JspStateManagerImpl.java:406)
      at javax.faces.application.StateManagerWrapper.restoreView(StateManagerWrapper.java:86)
      at org.apache.myfaces.shared_impl.view.ViewDeclarationLanguageBase.restoreView(ViewDeclarationLanguageBase.java:106)
      at org.apache.myfaces.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:234)
      at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:83)
      at com.sun.facelets.FaceletViewHandler.restoreView(FaceletViewHandler.java:316)
      at org.ajax4jsf.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:107)
      at org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:109)
      at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:138)

        Issue Links

          Activity

          Hide
          Jakob Korherr added a comment -

          Hi Mark,
          I always run into this Exception when I have a JSF-page open in the browser, then restart the server and afterwards refresh the JSF-page in the browser or click on some commandButtons or -Links, because the state from "before-restart" is sent back to the server and somehow the server can't encrypt it after the restart.

          Are you restarting your application to cause this Exception?

          Show
          Jakob Korherr added a comment - Hi Mark, I always run into this Exception when I have a JSF-page open in the browser, then restart the server and afterwards refresh the JSF-page in the browser or click on some commandButtons or -Links, because the state from "before-restart" is sent back to the server and somehow the server can't encrypt it after the restart. Are you restarting your application to cause this Exception?
          Hide
          Leonardo Uribe added a comment -

          Duplicate of MYFACES-1838, and that one is not a bug, but we let it open.

          Show
          Leonardo Uribe added a comment - Duplicate of MYFACES-1838 , and that one is not a bug, but we let it open.

            People

            • Assignee:
              Leonardo Uribe
              Reporter:
              Mark Struberg
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development