3 Replies Latest reply on Sep 7, 2011 3:03 PM by Roberto Requena

    Problem with <rich:fileUpload>

    Roberto Requena Newbie

      Greetings.

      I have a problem with <rich:fileUpload>, when it starts to load the image is showing the progress bar, and when the image finishes loading throws the following error:

       

      2011-09-04 18:35:07,078 SEVERE [javax.enterprise.resource.webcontainer.jsf.lifecycle] (http-0.0.0.0-8080-1) JSF1054: (Phase ID: RESTORE_VIEW 1, View ID: ) Exception thrown during phase execution: javax.faces.event.PhaseEvent[source=com.sun.faces.lifecycle.LifecycleImpl@1a6270b] 
      2011-09-04 18:35:07,078 ERROR [org.ajax4jsf.webapp.BaseXMLFilter] (http-0.0.0.0-8080-1) Exception in the filter chain 
      javax.servlet.ServletException: viewId:/restringido/modulos/radiografias/cargar_radiografia_compartida.jsf - View /restringido/modulos/radiografias/cargar_radiografia_compartida.jsf could not be restored. 
          at javax.faces.webapp.FacesServlet.service(FacesServlet.java:270) 
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) 
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
          at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206) 
          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.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
          at com.oficcom.web.backend.beans.session.filters.SeguridadFilter.doFilter(SeguridadFilter.java:114) 
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
          at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) 
          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:235) 
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) 
          at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190) 
          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525) 
          at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92) 
          at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126) 
          at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70) 
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) 
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) 
          at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) 
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) 
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330) 
          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829) 
          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598) 
          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) 
          at java.lang.Thread.run(Unknown Source) 
      Caused by: javax.faces.application.ViewExpiredException: viewId:/restringido/modulos/radiografias/cargar_radiografia_compartida.jsf - View /restringido/modulos/radiografias/cargar_radiografia_compartida.jsf could not be restored. 
          at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:185) 
          at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100) 
          at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:103) 
          at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) 
          at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265) 
          ... 30 more 
      2011-09-04 18:35:07,078 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/radisoftWeb].[Faces Servlet]] (http-0.0.0.0-8080-1) Servlet.service() para servlet Faces Servlet lanzó excepción 
      javax.faces.application.ViewExpiredException: viewId:/restringido/modulos/radiografias/cargar_radiografia_compartida.jsf - View /restringido/modulos/radiografias/cargar_radiografia_compartida.jsf could not be restored. 
          at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:185) 
          at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100) 
          at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:103) 
          at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) 
          at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265) 
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) 
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
          at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206) 
          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.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
          at com.oficcom.web.backend.beans.session.filters.SeguridadFilter.doFilter(SeguridadFilter.java:114) 
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
          at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) 
          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:235) 
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) 
          at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190) 
          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525) 
          at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92) 
          at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126) 
          at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70) 
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) 
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) 
          at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) 
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) 
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330) 
          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829) 
          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598) 
          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) 
          at java.lang.Thread.run(Unknown Source)
      

       

      I am using JSF 1.2 and RichFaces 3.3 and my backing bean is request scope. if you have any suggestions thank you very much.


        • 1. Re: Problem with <rich:fileUpload>
          Ilya Shaikovsky Master

          need to see the web.xml.

          • 2. Re: Problem with <rich:fileUpload>
            Roberto Requena Newbie

            Another thing, I've tested my application on my development machine that has Linux and it works correctly, and I've also tested on a machine that has windows home server and working properly. But the machine that the application goes to production I get the above error the configuration of this machine is as follows:

             

            OS: Microsoft Windows Server 2003 Enterprise Edition (Service Pack 2)

            CPU: Pentium (R) Dua-Core CPU E5200@2.50GHz 2.50GHz

            Memory: 1.96 GB of RAM.

            JAVA: java version "1.6.0_24" Java (TM) SE Runtime Environment (build1.6.0_24-b07)

            Application Server: JBoss 5.1.0.GA

             

            My application is developed with:

             

            JSF 1.2

            Rich Faces 3.3.3 Final

            Facelets

            EJB 3.0

            JPA

             

            and this is the configuration of my web.xml

             

            <?xml version="1.0"?>
            <web-app id="WebApp_ID" 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">
            <display-name>com.oficcom.radisof-Web</display-name>
            <context-param>
              <param-name>com.sun.faces.responseBufferSize</param-name>
              <param-value>500000</param-value>
            </context-param>
            <context-param>
              <param-name>facelets.DEVELOPMENT</param-name>
              <param-value>false</param-value>
            </context-param>
            <!-- colocar en 2 para desarrollo-->
            <context-param>
              <param-name>facelets.REFRESH_PERIOD</param-name>
              <param-value>-1</param-value>
            </context-param>
            <context-param>
              <param-name>com.sun.faces.serializationProvider</param-name>
              <param-value>org.jboss.web.jsf.integration.serialization.JBossSerializationProvider</param-value>
            </context-param>
            <!-- Fin -->
            <context-param>
              <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
              <param-value>server</param-value>
            </context-param>
            <context-param>
              <param-name>javax.faces.CONFIG_FILES</param-name>
              <param-value>/WEB-INF/faces-config.xml,/WEB-INF/faces-managed-beans.xml,/WEB-INF/faces-navigation.xml</param-value>
            </context-param>
            <context-param>
              <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
              <param-value>.xhtml</param-value>
            </context-param>
            <context-param>
              <param-name>org.richfaces.SKIN</param-name>
              <param-value>ruby</param-value>
            </context-param>
            <filter>
              <display-name>Ajax4jsf Filter</display-name>
              <filter-name>ajax4jsf</filter-name>
              <filter-class>org.ajax4jsf.Filter</filter-class>
              <init-param>
               <param-name>createTempFiles</param-name>
               <param-value>true</param-value>
              </init-param>
              <!-- maxRequestSize = 3mb-->
              <init-param>
               <param-name>maxRequestSize</param-name>
               <param-value>3145728</param-value>
              </init-param>
              <!-- Para produccion-->
              <init-param>
               <param-name>forceparser</param-name>
               <param-value>false</param-value>
              </init-param>
            </filter>
            <!-- Configuracion del Filtro de Seguridad -->
            <filter>
              <display-name>Filtro de Seguridad</display-name>
              <filter-name>seguridadFilter</filter-name>
              <filter-class>com.oficcom.web.backend.beans.session.filters.SeguridadFilter</filter-class>
            </filter>
            <filter-mapping>
              <filter-name>ajax4jsf</filter-name>
              <servlet-name>Faces Servlet</servlet-name>
              <dispatcher>REQUEST</dispatcher>
              <dispatcher>FORWARD</dispatcher>
              <dispatcher>INCLUDE</dispatcher>
            </filter-mapping>
            <filter-mapping>
              <filter-name>seguridadFilter</filter-name>
              <url-pattern>/restringido/*</url-pattern>
            </filter-mapping>
            <!-- Configuracion del Servlet de JSF -->
            <servlet>
              <servlet-name>Faces Servlet</servlet-name>
              <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
              <load-on-startup>0</load-on-startup>
            </servlet>
            <!-- Configuracion del Servlet de JFreeChart -->
            <servlet>
              <servlet-name>DisplayChart</servlet-name>
              <servlet-class>org.jfree.chart.servlet.DisplayChart</servlet-class>
              <load-on-startup>1</load-on-startup>
            </servlet>
            <!-- Configuracion del Servlet de Imagenes -->
            <servlet>
              <description>Servlet que carga y muestra las imagenes que se encuentran en el servidor</description>
              <display-name>RecursoImagenSerlevt</display-name>
              <servlet-name>RecursoImagenSerlevt</servlet-name>
              <servlet-class>com.oficcom.web.util.imagenes.serlevts.ImagenesSerlevt</servlet-class>
            </servlet>
            <!-- Configuracion del Servlet de Manejo de Errores -->
            <servlet>
              <servlet-name>ErrorHandleSerlevt</servlet-name>
              <servlet-class>com.oficcom.web.util.error.handle.serlevts.ErrorHandleSerlevt</servlet-class>
              <load-on-startup>1</load-on-startup>
            </servlet>
            <servlet-mapping>
              <servlet-name>Faces Servlet</servlet-name>
              <url-pattern>*.jsf</url-pattern>
            </servlet-mapping>
            <servlet-mapping>
              <servlet-name>DisplayChart</servlet-name>
              <url-pattern>/servlet/DisplayChart</url-pattern>
            </servlet-mapping>
            <servlet-mapping>
              <servlet-name>RecursoImagenSerlevt</servlet-name>
              <url-pattern>/imagenes/servidor/*</url-pattern>
            </servlet-mapping>
            <servlet-mapping>
              <servlet-name>ErrorHandleSerlevt</servlet-name>
              <url-pattern>/error</url-pattern>
            </servlet-mapping>
            <!-- Paginas de bienvenida-->
            <welcome-file-list>
              <welcome-file>/index.html</welcome-file>
            </welcome-file-list>
            <!-- Paginas de Error -->
            <error-page>
              <error-code>401</error-code>
              <location>/error</location>
            </error-page>
            <error-page>
              <error-code>403</error-code>
              <location>/error</location>
            </error-page>
            <error-page>
              <error-code>404</error-code>
              <location>/error</location>
            </error-page>
            <error-page>
              <error-code>500</error-code>
              <location>/error</location>
            </error-page>
            <error-page>
              <exception-type>java.lang.Throwable</exception-type>
              <location>/error</location>
            </error-page>
            <!-- Configuracion de la seguridad -->
            <security-constraint>
              <display-name>Seguridad Web</display-name>
              <web-resource-collection>
               <web-resource-name>Administracion</web-resource-name>
               <url-pattern>/restringido/modulos/administracion/*</url-pattern>
              </web-resource-collection>
              <web-resource-collection>
               <web-resource-name>Modulos Restringidos</web-resource-name>
               <url-pattern>/restringido/modulos/*</url-pattern>
              </web-resource-collection>
            </security-constraint>
            <login-config>
              <auth-method>BASIC</auth-method>
              <form-login-config>
               <form-login-page>/inicio.jsf</form-login-page>
               <form-error-page>/errores/error.jsf</form-error-page>
              </form-login-config>
            </login-config>
            <security-role>
              <role-name>Administrador</role-name>
            </security-role>
            <security-role>
              <role-name>Gerente</role-name>
            </security-role>
            <security-role>
              <role-name>Cajero</role-name>
            </security-role>
            <security-role>
              <role-name>Operador</role-name>
            </security-role>
            <security-role>
              <role-name>Amacenista</role-name>
            </security-role>
            </web-app>
            
            • 3. Re: Problem with <rich:fileUpload>
              Roberto Requena Newbie

              greetings,

               

              I change the attribute to false <createTempFiles> in my web.xml and the component is working properly. Now comes one which I doubt, that the problem might be occasions for lack of permissions on the server. As I can I know or specify the path where temporary files are created. Because I read in the documentation to put that parameter to false is only recommended for uploadingimages of small size.

               

                <init-param>
                 <param-name>createTempFiles</param-name>
                 <param-value>false</param-value>
                </init-param>