3 Replies Latest reply on Mar 23, 2011 7:14 AM by Ilya Shaikovsky

    rich fileUpLoad error

    arturo eduardo cabrera cordoba Newbie

      hi, I have the following error:

       

      21-mar-2011 13:26:20 com.sun.faces.lifecycle.Phase doPhase

      GRAVE: JSF1054: (Phase ID: RESTORE_VIEW 1, View ID: ) Exception thrown during phase execution: javax.faces.event.PhaseEvent[source=com.sun.faces.lifecycle.LifecycleImpl@5381aa48]

      227689 [btpool0-6] ERROR org.ajax4jsf.webapp.BaseXMLFilter - Exception in the filter chain

      javax.servlet.ServletException: viewId:/pages/digitalizarDocumento.jsf - View /pages/digitalizarDocumento.jsf could not be restored.

              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:270)

              at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)

              at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)

              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:1084)

              at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:378)

              at org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)

              at org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)

              at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)

              at org.springframework.security.ui.ExceptionTranslationFilter.doFilterHttp(ExceptionTranslationFilter.java:101)

              at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)

              at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)

              at org.springframework.security.providers.anonymous.AnonymousProcessin

       

      I am used richfaces 3.3.3.FINAL.

      my web.xml is this:

       

          <!-- PARA QUE EL JBOSS USE EL MYFACES DEL WAR -->

          <context-param>

              <param-name>javax.faces.DEFAULT_SUFFIX</param-name>

              <param-value>.jspx</param-value>

          </context-param>

          <context-param>

              <param-name>facelets.REFRESH_PERIOD</param-name>

              <param-value>2</param-value>

          </context-param>

          <context-param>

              <param-name>javax.faces.DISABLE_FACELET_JSF_VIEWHANDLER</param-name>

              <param-value>true</param-value>

          </context-param>

          <!-- PARA QUE EL JBOSS USE EL MYFACES DEL WAR -->

          <!--

        <context-param>

          <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>

          <param-value>true</param-value>

        </context-param>

        -->

          <context-param>

              <param-name>javax.faces.STATE_SAVING_METHOD</param-name>

              <param-value>server</param-value>

          </context-param>

          <context-param>

              <param-name>javax.faces.application.CONFIG_FILES</param-name>

              <param-value>/WEB-INF/faces-config.xml</param-value>

          </context-param>

          <!--

          <context-param>

              <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>

              <param-value>true</param-value>

          </context-param>

       

          <context-param>

              <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>

              <param-value>false</param-value>

          </context-param>

       

          <context-param>

              <param-name>org.apache.myfaces.PRETTY_HTML</param-name>

              <param-value>true</param-value>

          </context-param>

       

          <context-param>

              <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>

              <param-value>true</param-value>

          </context-param>

           -->

          <context-param>

              <param-name>facelets.DEVELOPMENT</param-name>

              <param-value>true</param-value>

          </context-param>

          <context-param>

              <param-name>facelets.SKIP_COMMENTS</param-name>

              <param-value>true</param-value>

          </context-param>

          <context-param>

              <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>

              <param-value>com.sun.facelets.FaceletViewHandler</param-value>

          </context-param>

          <!--

           <context-param>

              <param-name>org.ajax4jsf.handleViewExpiredOnClient</param-name>

              <param-value>true</param-value>

           </context-param>   

           -->

          <!-- Disables the check for MyFacesExtensionsFilter -->

          <!--   

          <context-param> 

              <param-name>org.apache.myfaces.CHECK_EXTENSIONS_FILTER</param-name> 

              <param-value>false</param-value> 

          </context-param>

           -->

          <!-- Fin de la carga -->

       

          <!-- Carga de componentes del contexto del aplicativo -->

          <context-param>

        • 1. Re: rich fileUpLoad error
          Ilya Shaikovsky Master

          you skipped filter configuration entries showing web.xml. but them are important. remember that RichFaces filter should be first in filters chain.

          • 2. Re: rich fileUpLoad error
            arturo eduardo cabrera cordoba Newbie

            Hi, my web.xml is this:

             

            <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"

                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                xsi:schemaLocation="http://java.sun.com/xml/ns/javaee

                                   http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

             

                <!-- Definiciones globales del aplicativo -->

             

                <display-name>Workflow</display-name>

                <description>Workflow</description>   

             

                <!-- PARA QUE EL JBOSS USE EL MYFACES DEL WAR -->

                <context-param>

                    <param-name>javax.faces.DEFAULT_SUFFIX</param-name>

                    <param-value>.jspx</param-value>

                </context-param>

                <context-param>

                    <param-name>facelets.REFRESH_PERIOD</param-name>

                    <param-value>2</param-value>

                </context-param>

                <context-param>

                    <param-name>javax.faces.DISABLE_FACELET_JSF_VIEWHANDLER</param-name>

                    <param-value>true</param-value>

                </context-param>

                <!-- PARA QUE EL JBOSS USE EL MYFACES DEL WAR -->

                <!--

              <context-param>

                <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>

                <param-value>true</param-value>

              </context-param>

              -->

                <context-param>

                    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>

                    <param-value>server</param-value>

                </context-param>

                <context-param>

                    <param-name>javax.faces.application.CONFIG_FILES</param-name>

                    <param-value>/WEB-INF/faces-config.xml</param-value>

                </context-param>   

                <context-param>

                    <param-name>facelets.DEVELOPMENT</param-name>

                    <param-value>true</param-value>

                </context-param>

                <context-param>

                    <param-name>facelets.SKIP_COMMENTS</param-name>

                    <param-value>true</param-value>

                </context-param>

                <context-param>

                    <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>

                    <param-value>com.sun.facelets.FaceletViewHandler</param-value>

                </context-param>

                <!-- Fin de la carga -->

                <!-- Carga de componentes del contexto del aplicativo -->

                <context-param>

                    <param-name>contextConfigLocation</param-name>

                    <param-value>

                        classpath:/ar/gob/alcaldia/workflow/web/config/applicationContext.xml           

                    </param-value>

                </context-param>

                <context-param>

                    <description>

                        La pagina de error HTTP 500 sea customizada y no la de default

                      </description>

                    <param-name>org.apache.myfaces.ERROR_HANDLING</param-name>

                    <param-value>true</param-value>

                </context-param>

             

                <!-- Listener que tiene que estar para que funcione spring -->

                <listener>

                    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>

                </listener>

                <!-- Listener que tiene que estar para que funcione spring-security -->

                <listener>

                  <listener-class>org.springframework.security.ui.session.HttpSessionEventPublisher</listener-class>                    

                </listener>

             

                <!-- Filtros-->

             

                <!-- Filtro encoding. Define la codificación de caracteres en la que se representarán las páginas -->

                <filter>

                    <filter-name>encodingFilter</filter-name>

                    <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>

                    <init-param>

                        <param-name>encoding</param-name>

                        <param-value>UTF-8</param-value>

                    </init-param>

                </filter>

             

                <!-- Filtro de spring-security, determina o define la seguridad del aplicativo  -->

                <filter>

                    <filter-name>Spring security Filter Chain Proxy</filter-name>

                    <filter-class>org.springframework.security.util.FilterToBeanProxy</filter-class>

             

                    <init-param>

                        <param-name>targetBean</param-name>

                        <param-value>filterChainProxy</param-value>

                    </init-param>

                </filter>

                <!--

                <filter>

                    <filter-name>Spring security Basic Filter Chain Proxy</filter-name>

                    <filter-class>org.springframework.security.util.FilterToBeanProxy</filter-class>

                    <init-param>

                        <param-name>targetBean</param-name>

                        <param-value>basicFilterChainProxy</param-value>

                    </init-param>

                </filter>

                 -->

                <!-- Filtro de hibernate.  -->

                <!--

                <filter>

                    <filter-name>hibernateFilter</filter-name>

                    <filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>

                </filter >

                 -->

                <!--

             

                -->

                 <!--

                 -->

                <!-- Filtros de JSF -->

             

                <filter>

                    <display-name>RichFaces Filter</display-name>

                    <filter-name>richfaces</filter-name>

                    <filter-class>org.ajax4jsf.Filter</filter-class>

                     <init-param>

                         <param-name>maxRequestSize</param-name>

                         <param-value>5000000</param-value>

                     </init-param>

                     <init-param>

                         <param-name>createTempFiles</param-name>

                         <param-value>true</param-value>

                         <!-- <param-value>true</param-value>-->

                     </init-param>

                </filter>

             

                 <!--

                <filter>

                    <display-name>RichFaces Filter</display-name>

                    <filter-name>richfaces</filter-name>

                    <filter-class>org.ajax4jsf.Filter</filter-class>

                </filter>

                 -->

                <!-- Mapeo de los diferentes filtros -->

                <!-- 

                <filter-mapping>

                   <filter-name>encodingFilter</filter-name>

                   <url-pattern>/bin/*</url-pattern>

                </filter-mapping>

                 -->

                 <!--

                <filter-mapping>

                   <filter-name>hibernateFilter</filter-name>

                   <url-pattern>/services/*</url-pattern>

                </filter-mapping>

                <filter-mapping>

                   <filter-name>hibernateFilter</filter-name>

                   <url-pattern>/services-adhoc/*</url-pattern>

                </filter-mapping>

                 -->

                  <!-- 

                <filter-mapping>

                    <filter-name>extensionsFilter</filter-name>       

                    <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>

                </filter-mapping>

             

                <filter-mapping>

                    <filter-name>extensionsFilter</filter-name>

                    <url-pattern>*.faces</url-pattern>

                </filter-mapping>

                <filter-mapping>

                    <filter-name>extensionsFilter</filter-name>

                    <url-pattern>*.jsp</url-pattern>

                </filter-mapping>

                <filter-mapping>

                    <filter-name>extensionsFilter</filter-name>

                    <servlet-name>Faces Servlet</servlet-name>

                </filter-mapping>

                -->

             

                <filter-mapping>

                    <filter-name>richfaces</filter-name>

                    <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>

                </filter-mapping>

             

                <filter-mapping>

                    <filter-name>richfaces</filter-name>

                    <url-pattern>*.faces</url-pattern>

                </filter-mapping>

                <filter-mapping>

                    <filter-name>richfaces</filter-name>

                    <url-pattern>*.jspx</url-pattern>

                </filter-mapping>

             

                <filter-mapping>

                    <filter-name>richfaces</filter-name>

                    <servlet-name>Faces Servlet</servlet-name>

                    <dispatcher>REQUEST</dispatcher>

                    <dispatcher>FORWARD</dispatcher>

                    <dispatcher>INCLUDE</dispatcher>

                </filter-mapping>

             

             

             

                 <filter-mapping>

                   <filter-name>Spring security Filter Chain Proxy</filter-name>

                   <url-pattern>*.jsf</url-pattern>

                   <dispatcher>FORWARD</dispatcher>

                   <dispatcher>REQUEST</dispatcher>

               </filter-mapping>

             

               <filter-mapping>

                   <filter-name>Spring security Filter Chain Proxy</filter-name>

                   <url-pattern>*.jspx</url-pattern>

                   <dispatcher>FORWARD</dispatcher>

                   <dispatcher>REQUEST</dispatcher>

               </filter-mapping>

             

                <!-- IntrospectorCleanupListener -->

                <listener>

                    <listener-class>

                        org.springframework.web.util.IntrospectorCleanupListener</listener-class>

                </listener>

                <!-- pertenece a myfaces

                <listener>

                    <listener-class>

                        org.apache.myfaces.webapp.StartupServletContextListener</listener-class>

                </listener>

                 -->

                <!-- Servlet de JSF -->

                <servlet>

                    <servlet-name>Faces Servlet</servlet-name>

                    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>

                    <load-on-startup>1</load-on-startup>

                </servlet>

             

             

                <!-- Mapping -->

                <servlet-mapping>

                    <servlet-name>Faces Servlet</servlet-name>

                    <url-pattern>*.jsf</url-pattern>

                </servlet-mapping>   

             

                  <jsp-config>

                    <jsp-property-group>

                        <url-pattern>*.jspx</url-pattern>

                        <page-encoding>UTF-8</page-encoding>

                        <trim-directive-whitespaces>

                            true

                        </trim-directive-whitespaces>

                    </jsp-property-group>

                </jsp-config>

             

             

                 <!-- Definicion de paginas de errores JSF -->

             

                 <error-page>

                    <error-code>403</error-code>

                    <location>/pages/accesoDenegado.jsf</location>

                </error-page>

             

                 <!-- Definicioón de las páginas de error y su correspondiente url -->

                <session-config>

                    <session-timeout>20</session-timeout><!-- minutes of inactivity -->

                </session-config>

            </web-app>

             

            I am sorry. I do not attach files in the forum.

            • 3. Re: rich fileUpLoad error
              Ilya Shaikovsky Master

              RF filter is not first in chaing in your case. place filter mapping with url-pattern to be first.