users@glassfish.java.net

Mysterious FacesFileNotFoundException

From: <forums_at_java.net>
Date: Mon, 15 Aug 2011 10:49:44 -0500 (CDT)

A user tells me that they went to my JSF web app's login screen, logged in,
then got an error. GlassFish's log shows the following:
com.sun.faces.context.FacesFileNotFoundException at
com.sun.faces.facelets.impl.DefaultFaceletFactory.resolveURL(DefaultFaceletFactory.java:232)
at
com.sun.faces.facelets.impl.DefaultFaceletFactory.resolveURL(DefaultFaceletFactory.java:273)
at
com.sun.faces.facelets.impl.DefaultFaceletFactory.getMetadataFacelet(DefaultFaceletFactory.java:209)
at
com.sun.faces.application.view.ViewMetadataImpl.createMetadataView(ViewMetadataImpl.java:114)
at
com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:230)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) at
com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:113)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) at
javax.faces.webapp.FacesServlet.service(FacesServlet.java:409) .... So some
file was not found during RestoreVew phase, but it doesn't say which file was
not found. If a JSF template file was not found then it would have shown a
different exception (I have a custom ResourceResolver for a themes/branding
feature): java.io.FileNotFoundException: /path/to/templates/MyTemplate.xhtml
(No such file or directory) at java.io.FileInputStream.open(Native Method) at
java.io.FileInputStream.(FileInputStream.java:106) at
java.io.FileInputStream.(FileInputStream.java:66) at
sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:70)
at
sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:161)
at
com.sun.faces.facelets.impl.DefaultFaceletCache._getLastModified(DefaultFaceletCache.java:172)
at
com.sun.faces.facelets.impl.DefaultFaceletCache.access$000(DefaultFaceletCache.java:62)
at
com.sun.faces.facelets.impl.DefaultFaceletCache$1.newInstance(DefaultFaceletCache.java:82)
If the user stayed on the login screen for too long before logging in and
their session expired, it would have shown a different error and re-displayed
the login screen: javax.faces.application.ViewExpiredException:
viewId:/Login.jsf - View /Login.jsf could not be restored. at
com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:202)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) at
com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:113)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) at
javax.faces.webapp.FacesServlet.service(FacesServlet.java:409) So what can
cause com.sun.faces.context.FacesFileNotFoundException to happen? Why can't I
reproduce it? We're on GlassFish 3.1-b43 and JSF RI 2.1.2 (we patched it a
while back for bug fixes) Thanks, Ryan

--
[Message sent by forum member 'rdelaplante']
View Post: http://forums.java.net/node/833544