fileUpload - ViewExpiredException

Components, Ajax Framework, Utilities and More.
bornsilly
Posts: 27
Joined: 19 Mar 2010, 15:41
Location: Netherlands

18 Aug 2010, 16:40

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:

Code: Select all

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 http://primefaces.prime.com.tr/forum/vi ... ion#p16868 didnt work either. Also if i try it in Internet Explorer it doesnt work.

Code: Select all

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

Code: Select all

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

Code: Select all

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

User avatar
optimus.prime
Prime
Posts: 17328
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

19 Aug 2010, 00:51

Can't replicate it, what is your server?

bornsilly
Posts: 27
Joined: 19 Mar 2010, 15:41
Location: Netherlands

19 Aug 2010, 07:56

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

User avatar
jomaora
Posts: 29
Joined: 05 May 2010, 16:07
Location: Bucaramanga, Colombia --> Clermont-Ferrand, France

19 Aug 2010, 13:35

Hi bornsilly,

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

Code: Select all

<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.

User avatar
optimus.prime
Prime
Posts: 17328
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

19 Aug 2010, 13:43

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

bornsilly
Posts: 27
Joined: 19 Mar 2010, 15:41
Location: Netherlands

19 Aug 2010, 13:51

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

bornsilly
Posts: 27
Joined: 19 Mar 2010, 15:41
Location: Netherlands

19 Aug 2010, 13:52

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

User avatar
optimus.prime
Prime
Posts: 17328
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

19 Aug 2010, 13:57

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

bornsilly
Posts: 27
Joined: 19 Mar 2010, 15:41
Location: Netherlands

19 Aug 2010, 14:16

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/vi ... ion#p16868
http://primefaces.prime.com.tr/forum/vi ... ion#p16054
http://primefaces.prime.com.tr/forum/vi ... tion#p4864
PrimeFaces 3.3.4, Primefaces-extensions 0.6.0, JBoss 7.1, Mojarra 2.1.10

bornsilly
Posts: 27
Joined: 19 Mar 2010, 15:41
Location: Netherlands

19 Aug 2010, 18:14

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

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 7 guests