• Post Reply Bookmark Topic Watch Topic
  • New Topic

FacesServlet not found

 
Raaga Maalika
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, am a newbie to JSF. Through pom.xml, I'm using the following jar files in my app:
jsf-impl-1.2-b19.jar
javax.faces-api-2.1.jar

I have written a simple JSF page called simplePage.jsp under 'src/webapp/' dir. This is the content of simplePage.jsp:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">

<f:view>
<h:form>
<h:graphicImage id="Cognizant" value="CognizantScala.JPG"></h:graphicImage>
<h:graphicImage id="bookworm" value="Bookworm.gif"></h:graphicImage>
<h2>Hi. Welcome to the Book Application</h2>
</h:form>
</f:view>
</html>


When I start the app using the command (jetty server) :
>mvn jetty:run

Jetty throws an error saying :

2011-09-05 16:30:10.187:WARN::EXCEPTION
java.lang.ClassNotFoundException: javax.faces.webapp.FacesServlet
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoade
r.java:392)
at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoade
r.java:363)
at org.mortbay.util.Loader.loadClass(Loader.java:91)
...
...


Why is it saying that the 'FacesServlet' isn't found, despite me including the api & impl jar files? How do I handle this? Can someone please help?
 
Tim Holloway
Bartender
Posts: 18408
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your JSF SimplePage seems to be OK. Why it is that FacesServlet isn't found at all isn't apparent to me, but it does look like you're mixing a JSF 1.2 implementation with a JSF2 api definition and I don't think that's likely to work too well.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!