File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Error during navigation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Error during navigation" Watch "Error during navigation" New topic
Author

Error during navigation

prathibha shiju
Greenhorn

Joined: Jun 19, 2007
Posts: 17
hi,
i created a simple application in jsf for page navigation.with out building that works in tomcat. and i tried to run the war file in jboss .
and i got the following exception.
the folder structure if my war file is

meta-inf , web-inf ,firstpage.jsp , secondpage.jsp, index.jsp
| |
V V
manifest.mf application.xml,faces-config.xml,web.xml




javax.servlet.ServletException: viewId:/firstpage.jsf - View /firstpage.jsf could not be restored.
javax.faces.webapp.FacesServlet.service(FacesServlet.java:249)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)


root cause

javax.faces.application.ViewExpiredException: viewId:/firstpage.jsf - View /firstpage.jsf could not be restored.
com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:187)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

can anyone tell me, what i have to change to make that application running correctly.?

regards
prathibha
Dushyant Agarwal
Ranch Hand

Joined: Oct 14, 2007
Posts: 75
Hi,
You can put your web.xml and faces-config.xml inside the web-inf folder and then deploy the application.

May be your session just timed out and your view got expired. Or the application may have got restarted and the client id for your previous view is not the same as the current view.

Also do not keep any jar files related with JSF inside the WEB-INF/lib as JBoss is equipped with inbuilt implementation of JBoss
[ January 31, 2008: Message edited by: Dushyant Agarwal ]
prathibha shiju
Greenhorn

Joined: Jun 19, 2007
Posts: 17
hi ,
actually that web.xml,application.xml and faces-config.xml are inside web-inf only.what you saw was a typing problem.
still thats not working.
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Originally posted by prathibha shiju:
hi ,
actually that web.xml,application.xml and faces-config.xml are inside web-inf only.what you saw was a typing problem.
still thats not working.


Seems a problem with mappings in web.xml. Can you post that here?
prathibha shiju
Greenhorn

Joined: Jun 19, 2007
Posts: 17
This is my web.xml:....

<web-app>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>

<!-- Faces Servlet -->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup> 1 </load-on-startup>
</servlet>

<!-- Faces Servlet Mapping -->
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>


</web-app>




This is my faces-config.xml:..........

<faces-config>
<navigation-rule>
<from-view-id>firstpage.jsp</from-view-id>
<navigation-case>
<from-outcome>secondpage</from-outcome>
<to-view-id>secondpage.jsp</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>

please help me...
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
One thing is, prefix the path with forward slash (/) in navigation rules:

For example:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error during navigation