Board index JavaServer Faces General fileUpload - ViewExpiredException

fileUpload - ViewExpiredException

Components, Ajax Framework, Utilities and More.


Posts: 27
Location: Netherlands
I was just about to post about a zipexception that i got when using the fileUpload component but read that changing my STATE_SAVING_METHOD to server would solve.
However straight after i got a new error:

SEVERE: Servlet.service() for servlet Faces Servlet threw exception
javax.faces.application.ViewExpiredException: viewId:/ui/msgUpload.jsf - View /ui/msgUpload.jsf could not be restored.
   at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:212)


I searched the forums and found some information about it but from what i understand is that if i use server that this shouldn't be happening?

Edit:

I also tried with the latest beta version but yet the same problem. Only thing is that on the form itself it doesn't display a error but in the logs i can see it generating a ViewExpiredException.

the solution as provided in viewtopic.php?f=3&t=3543&p=16868&hilit=javax.faces.application.ViewExpiredException#p16868 didnt work either. Also if i try it in Internet Explorer it doesnt work.

               
    <h:form>
        <h:commandLink action="uploadFiles" >
        <h:outputText value="Upload your files" />
   </h:commandLink>>
</h:form>


xhtml being displayed:

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
   xmlns:ui="http://java.sun.com/jsf/facelets"
   xmlns:h="http://java.sun.com/jsf/html"
   xmlns:f="http://java.sun.com/jsf/core"
   xmlns:p="http://primefaces.prime.com.tr/ui"
   template="../template/messageStore.xhtml">

   <ui:define name="content">
      <div class="msgstore_msgHeader ui-widget-header">
         <h:outputText value="Upload EDI files." />
      </div>
      <div class="msgstore_content">
      
         <h:form class="content">
         
            <p:fileUpload fileUploadListener="#{FileUploadController.uploadFile}" multiple="true" label="Choose" description="Files"/>
            
         </h:form>
      
      </div>    
                  

   </ui:define>
</ui:composition>


Java Bean:

public class FileUploadController {

   private Logger logger = Logger.getLogger(FileUploadController.class.getName());
   
   public void uploadFile( FileUploadEvent event) {
      logger.log(Level.INFO, "Uploaded: {0}", event.getFile().getFileName());

   }
   
   
}
PrimeFaces 3.3.4, Primefaces-extensions 0.6.0, JBoss 7.1, Mojarra 2.1.10


Posts: 15071
Location: Cybertron

Can't replicate it, what is your server?
PrimeFaces Lead


Posts: 27
Location: Netherlands
Hi Prime,

With server you mean if i am using Tomcat, netbeans or JBoss? If so i am Using Tomcat 7.00 (sorry if i am asking the obvious but added my details as my signature including server).
PrimeFaces 3.3.4, Primefaces-extensions 0.6.0, JBoss 7.1, Mojarra 2.1.10


Posts: 29
Location: Bucaramanga, Colombia --> Clermont-Ferrand, France
Hi bornsilly,

Did you add the configuration for the fileUpload in your web.xml??

<filter>
   <filter-name>PrimeFaces FileUpload Filter</filter-name>
   <filter-class>org.primefaces.webapp.filter.FileUploadFilter</filter-class>
</filter>
<filter-mapping>
   <filter-name>PrimeFaces FileUpload Filter</filter-name>
   <servlet-name>Faces Servlet</servlet-name>
</filter-mapping>


I check a code that I have using a fileUpload, on IE7 and it's not as different as yours and it works fine.

Regards!
JSF 2.0. Primefaces 2.0.2. Apache Tomcat 6.


Posts: 15071
Location: Cybertron

Can you test with tomcat6 to see if it makes a sense, I can't replicate this issue.
PrimeFaces Lead


Posts: 27
Location: Netherlands
Hi bornsilly,

Did you add the configuration for the fileUpload in your web.xml??


I have indeed the configuration for the fileUpload in my web.xml.

It is a odd problem to which i have no idea what the cause is.
PrimeFaces 3.3.4, Primefaces-extensions 0.6.0, JBoss 7.1, Mojarra 2.1.10


Posts: 27
Location: Netherlands
Optimus,

I can have Tomcat 6 installed so i could test it. Am just not sure what to do to "downgrade" my project to Tomcat 6.
Is it a matter of just choosing Tomcat 6 instead of Tomcat 7 or do i need to some additional things?
PrimeFaces 3.3.4, Primefaces-extensions 0.6.0, JBoss 7.1, Mojarra 2.1.10


Posts: 15071
Location: Cybertron

I don't know really as it is the first time I've encountered with such an error for fileupload.
PrimeFaces Lead


Posts: 27
Location: Netherlands
Optimus.Prime.

I meant more can i in eclipse just select tomcat as my server or do i need to do additional things to make my project compatible to run on Tomcat 6?

Also the problem i am having has been reported a few times but unfortunately none of the solutions were applicable to me:

Threads:
http://primefaces.prime.com.tr/forum/viewtopic.php?f=3&t=3543&p=16868&hilit=ViewExpiredException#p16868
http://primefaces.prime.com.tr/forum/viewtopic.php?f=3&t=3493&p=16054&hilit=ViewExpiredException#p16054
http://primefaces.prime.com.tr/forum/viewtopic.php?f=3&t=1049&p=4864&hilit=ViewExpiredException#p4864
PrimeFaces 3.3.4, Primefaces-extensions 0.6.0, JBoss 7.1, Mojarra 2.1.10


Posts: 27
Location: Netherlands
Optimus,

I have been trying to get the webapp working under Tomcat 6 but this seems to be impossible. I deployed it as war and it works alright under tomcat 7 (except for the FileUpload) and under Tomcat 6 it starts but doesnt display anything related to primefaces.

Do you have any idea were i can look to understand the cause of the ViewExpiredException. In my opinion it shouldnt even be related to uploading a file, or its the progressbar that is causing the problem.
PrimeFaces 3.3.4, Primefaces-extensions 0.6.0, JBoss 7.1, Mojarra 2.1.10

Next

Return to General