aspose file tools
The moose likes JSF and the fly likes Servlet  Exception in Servlet.init() for servlet Faces Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "Servlet  Exception in Servlet.init() for servlet Faces " Watch "Servlet  Exception in Servlet.init() for servlet Faces " New topic
Author

Servlet Exception in Servlet.init() for servlet Faces

Rajat Bhatnagar
Greenhorn

Joined: Mar 11, 2008
Posts: 22
I am trying to deploy my first JSF application in tomcat 5.5 . The directory structure is fine and so are the tag entries in faces-config.xml and web.xml.

But when i try to deploy it in Tomcat it throws an exception.
I tried 3 alternatives as seen in forums but they don't work:

These Alternatives are

1. PLace jstl.jsr in lib folder of tomcat

2. add this entry to the web.xml of application
<listener>
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
</listener>

3. add this entry to the web.xml of application
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>


The StackTrace is


message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Servlet.init() for servlet Faces Servlet threw exception
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
java.lang.Thread.run(Unknown Source)


root cause

java.lang.NullPointerException
javax.faces.webapp.FacesServlet.init(FacesServlet.java:144)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
[ September 23, 2008: Message edited by: Rajat Bhatnagar ]

Regards<br />Rajat Bhatnagar<br /><a href="http://guideofgreatness.googlepages.com" target="_blank" rel="nofollow">http://guideofgreatness.googlepages.com</a>
John Abjanic
Greenhorn

Joined: Dec 11, 2008
Posts: 1
I am having the same problem, did you ever get this problem solved?
Thanks, John
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Rather start your own topic instead of hijacking other's topic.

Paste the entire stacktrace in your new topic and show the minimal contents of the web.xml and faces-config.xml files which still reproduces this problem (maybe you should already have solved the problem while stripping out the web.xml and faces-config.xml from unnecessary stuff ;) ). Good luck.


Code depot of a Java EE / JSF developer | JSF / Eclipse / Tomcat kickoff tutorial | DAO kickoff tutorial | I ♥ Unicode
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Servlet Exception in Servlet.init() for servlet Faces
 
Similar Threads
servlet exception
servlet exception!!!!
Servlet not being called
javax.servlet.ServletException: Error allocating a servlet instance
Error allocating a servlet instance.