- This topic has 8 replies, 2 voices, and was last updated 13 years, 9 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.September 21, 2011 at 4:16 am #319818
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.
September 21, 2011 at 1:19 pm #319835
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?September 21, 2011 at 1:47 pm #319837
ssquireMemberWhen I run this URL, http://localhost:8080/JSFLoginDemo/userLogin.faces I get the error message “the web page can not be found”.
September 21, 2011 at 1:57 pm #319838
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”.
September 21, 2011 at 10:03 pm #319844
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.
September 22, 2011 at 12:33 am #319849
support-swapnaModeratorssquire ,
Glad that it is working.
Do let us know if you have any other issues.September 22, 2011 at 9:21 am #319864
ssquireMemberSwapna,
When can we expect MyEclipse 10?The wizards would be very helpful in JSF 2.0 development.
September 22, 2011 at 10:03 pm #319872
support-swapnaModeratorssquire ,
MyEclipse 10 is due to release early next month.
Thanks.
-
AuthorPosts