- This topic has 8 replies, 2 voices, and was last updated 13 years, 2 months ago by support-swapna.
-
AuthorPosts
-
ssquireMemberI created a project that is virtually modeled off of the JSF Tutorial. It Previews fine, but when I try to run it on the MyEclipse Tomcat Server it produces a “Can not find FacesContext error. I have attached a file with the complete error message and a zipped file of my project from the MyEclipse Open Explorer Window, an error log from 9/20/2011, a configuration log.
I’m using MyEclipse Spring 9.1.
Please help.
Attachments:
You must be logged in to view attached files.
support-swapnaModeratorssquire,
Thank you for the details.
1) JSF 1.2 supports Java EE 5 projects and JSF 2.0 supports Java EE 6 projects. Make sure you have updated the web.xml and the faces-config.xml deployment descriptor accordingly. The DD changes between JSF 1.2 and JSF 2.0.
2) If you do not access the URL which ends in .faces ex : http://localhost:8080/JSFLoginDemo/userLogin.faces , you will get an exception along the lines of “FacesContext cannot be found”. Can you recheck it ?
Let me know how this works for you.
ssquireMemberSwapna,
am I missing something here? I can’t seem to find a single source on Google that defines what the deployment descriptor for JSF 2.0 Java EE 6 should be. Do you have a link to this information available?
ssquireMemberWhen I run this URL, http://localhost:8080/JSFLoginDemo/userLogin.faces I get the error message “the web page can not be found”.
ssquireMemberI changed my web.xml deployment descriptor to:
<web-app
xmlns=”http://java.sun.com/xml/ns/javaee”
xmlns:web=”http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd”
xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
xsi:schemaLocation=”http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd”
version=”2.5″>and my faces-config.xml deployment descriptor to:
<faces-config
xmlns=”http://java.sun.com/xml/ns/javaee”
xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
xsi:schemaLocation=”http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd”
version=”2.0″>and I still get the same “cannot find FacesContext error”.
ssquireMemberSwapna,
I figured it out. Sorry for wasting your time, it was simple. I needed to access my userLogin.jsp file as userLogin.faces. I’m glad it worked because I redid the project as Java EE5 & JSF 1.2 and that’s where I saw the error of my ways. I didn’t want to start building this thing without using the most up to date technology (ie. Java EE 6, JSF 2.0, & JPA rather than EJB).
I should be good to go for a while (I hope).Thanks for bearing with me as I learn this stuff.
support-swapnaModeratorssquire ,
Glad that it is working.
Do let us know if you have any other issues.
ssquireMemberSwapna,
When can we expect MyEclipse 10?The wizards would be very helpful in JSF 2.0 development.
support-swapnaModeratorssquire ,
MyEclipse 10 is due to release early next month.
Thanks.
-
AuthorPosts