[ 
https://issues.apache.org/jira/browse/MYFACES-1838?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12620238#action_12620238
 ] 

keywan edited comment on MYFACES-1838 at 8/6/08 5:59 AM:
-------------------------------------------------------------

The patch catches the exception and returng null in the 
HtmlResponseStateManager, but this will result in an 
javax.faces.application.ViewExpiredException.
I would like myfaces to create a facesmassage, create a new state and display 
the site, so the user is infored that he have to refill the form, but the user 
should be able to proceed.

For know i will try a workaround :
handel the exception at my error page. There i can get the reason and if it is 
an javax.faces.application.ViewExpiredException, i will give a message and 
redirect to the orgin page.

For those who haven't yet my patch build in, also can create a errorpage to 
catach the badpadding exception:
in web.xml you can set an error page but dont forgett to disable facelets 
or/and mayfaces errorpages
 <context-param>
  <param-name>org.apache.myfaces.ERROR_HANDLING</param-name>
  <param-value>false</param-value>
 </context-param>
 <context-param>
  <param-name>facelets.DEVELOPMENT</param-name>
  <param-value>false</param-value>
 </context-param>
 <error-page>
  <exception-type>javax.servlet.ServletException</exception-type>
  <location>/error.jsp</location>
 </error-page>

the error page must handle, the exceptionen, hopefully that some day we can 
register a Exceptionhandler, i siply call my Exceptionhandler at this page. But 
u can remove this lines and try to add a  workaround .

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<[EMAIL PROTECTED] import="com.ibson.errorhandling.ServletExceptionHandler"%>
<[EMAIL PROTECTED] isErrorPage="true" %>
<html>
<head></head>
        <body>
        <%
                ServletExceptionHandler handler = new 
ServletExceptionHandler();   
                handler.handle(pageContext,"/pages/error.jsf");
        %>      
        </body>
</html>


      was (Author: keywan):
    The patch catches the exception and returng null in the 
HtmlResponseStateManager, but this will result in an 
javax.faces.application.ViewExpiredException.
I would like myfaces to create a facesmassage, create a new state and display 
the site, so the user is infored that he have to refill the form, but the user 
should be able to proceed.

For know i will try a workaround :
handel the exception at my error page. There i can get the reason an if it ist 
a javax.faces.application.ViewExpiredException, i will give a message and 
redirect to the orgin page.

For those who haven't yet my patch build in, also can create a errorpage to 
catach the badpadding exception:
in web.xml you can set an error page but dont forgett to disable facelets 
or/and mayfaces errorpages
 <context-param>
  <param-name>org.apache.myfaces.ERROR_HANDLING</param-name>
  <param-value>false</param-value>
 </context-param>
 <context-param>
  <param-name>facelets.DEVELOPMENT</param-name>
  <param-value>false</param-value>
 </context-param>
 <error-page>
  <exception-type>javax.servlet.ServletException</exception-type>
  <location>/error.jsp</location>
 </error-page>

the error page must handle, the exceptionen, hopefully that some day we can 
register a Exceptionhandler, i siply call my Exceptionhandler at this page. But 
u can remove this lines and try to add a  workaround .

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<[EMAIL PROTECTED] import="com.ibson.errorhandling.ServletExceptionHandler"%>
<[EMAIL PROTECTED] isErrorPage="true" %>
<html>
<head></head>
        <body>
        <%
                ServletExceptionHandler handler = new 
ServletExceptionHandler();   
                handler.handle(pageContext,"/pages/error.jsf");
        %>      
        </body>
</html>

  
> javax.crypto.BadPaddingException: Given final block not properly padded
> -----------------------------------------------------------------------
>
>                 Key: MYFACES-1838
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1838
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 1.2.2
>            Reporter: Guy Bashan
>         Attachments: MYFACES-1838.patch
>
>
> I keep getting this exception from time to time when moving between pages:
> javax.faces.FacesException: javax.crypto.BadPaddingException: Given final 
> block not properly padded
>       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:184)
>       at 
> org.apache.myfaces.renderkit.html.HtmlResponseStateManager.getState(HtmlResponseStateManager.java:136)
>       at 
> org.apache.myfaces.application.jsp.JspStateManagerImpl.restoreView(JspStateManagerImpl.java:289)
>       at 
> org.apache.myfaces.application.jsp.JspViewHandlerImpl.restoreView(JspViewHandlerImpl.java:505)
>       at 
> org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:85)
>       at 
> org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:103)
>       at 
> org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:76)
>       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:148)
>       at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>       at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>       at 
> com.vdo.admin.model.persistence.OpenSessionInViewFilterIC.doFilterInternal(OpenSessionInViewFilterIC.java:155)
>       at 
> com.vdo.admin.model.persistence.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:61)
>       at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>       at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>       at 
> org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
>       at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>       at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>       at 
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>       at 
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
>       at 
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>       at 
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>       at 
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>       at 
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
>       at 
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
>       at 
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
>       at 
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
>       at java.lang.Thread.run(Thread.java:619)
> 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:369)
>       ... 30 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to