Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JSF Deployment error - login.faces not available

843844Dec 1 2008 — edited Jan 15 2009
I am new to JSF and am having deploying my first example JSF pages in Eclipse on default Tomcat (6.x).

I feel I have done everything stated in the tutorial http://www.exadel.com/tutorial/jsf/jsftutorial-kickstart.html (I did not repeat the step by step instructions in the tutorial - instead, used these instructions to create my own pages / logic). However, I still get the following error:

HTTP Status 404 - /reportwriter/pages/login.faces

-----
type Status report

message /reportwriter/pages/login.faces

description The requested resource (/reportwriter/pages/login.faces) is not available.


Here is my directory structure:

reportwriter
- src
- LoginBean
- LoginServer.java
- Resources.properties
- js
- html
- images
- pages
- login.jsp
- webRoot
- WEB-INF
- lib
- faces-config.xml
- web.xml
- index.jsp with a one line jsp forward to pages/login.faces



here is my faces-config.xml
<?xml version="1.0"?>

<!DOCTYPE faces-config PUBLIC
"-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
"http://java.sun.com/dtd/web-facesconfig_1_0.dtd">

<faces-config>
<application>
<message-bundle>LoginBean.Resources</message-bundle>
<locale-config>
<default-locale>en</default-locale>
<supported-locale>en-us</supported-locale>
<supported-locale>fr</supported-locale>
<supported-locale>es</supported-locale>
</locale-config>
<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
</application>

<navigation-rule>
<from-view-id>/pages/login.jsp</from-view-id>
<navigation-case>
<description>Handle case for successful login</description>
<from-action>#{loginServer.loginAction}</from-action>
<from-outcome>success</from-outcome>
<to-view-id>/pages/task.jsp</to-view-id>
</navigation-case>
<navigation-case>
<description>Handle case for unsuccessful login</description>
<from-action>#{loginServer.loginAction}</from-action>
<from-outcome>failure</from-outcome>
<to-view-id>/pages/failure.jsp</to-view-id>
</navigation-case>
</navigation-rule>



<navigation-rule>
<from-view-id>/pages/success.jsp</from-view-id>
<navigation-case>
<from-outcome>return</from-outcome>
<to-view-id>/pages/login.jsp</to-view-id>
</navigation-case>
</navigation-rule>

<navigation-rule>
<from-view-id>/pages/failure.jsp</from-view-id>
<navigation-case>
<from-outcome>return</from-outcome>
<to-view-id>/pages/login.jsp</to-view-id>
</navigation-case>
</navigation-rule>

<managed-bean>
<managed-bean-name>loginServer</managed-bean-name>
<managed-bean-class>LoginBean.LoginServer</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>



</faces-config>




and here is web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<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</param-value>
</context-param>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
<!-- 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>*.faces</url-pattern>
</servlet-mapping>
</web-app>



Can you think what I may be missing here to get the login.faces not available error?
One hint I have is - if I do not set a jsp forward line in the index.jsp file, I get the server deployment for the index.jsp file OK. But not when I have the forward from index.jsp to /pages/login.faces

I also tried setting the context in tomcat server.xml file as follows:
<Context debug="0"
docBase="C:/evsapi/ReportWriter/reportwriter/WebRoot"
path="/LoginBean" reloadable="true"/>

Still no use.

Please help!

Edited by: tipseeker on Dec 1, 2008 3:51 PM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 12 2009
Added on Dec 1 2008
8 comments
575 views