Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Cannot instantiate FacesServlet with Tomcat 7 even though jsf-api and jsf-impl are on the classpath  RSS feed

 
Himai Minh
Ranch Hand
Posts: 1563
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am running ch6's database example from Core JSF.

This is my context.xml in META-INF. I used MySQL database


I used ManagedBean and I run Apache Tomcat 7.


I put jsf-api-2.1.jar and jsf-impl-2.2.14.jar in the classpath.
I cannot put them in the <tomcat dir>/lib because Tomcat won't start with these two files in the lib directory. I don't know why.

My result is:

javax.servlet.ServletException: Error instantiating servlet class javax.faces.webapp.FacesServlet
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
......


root cause

java.lang.ClassNotFoundException: javax.faces.webapp.FacesServlet
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
....

note The full stack trace of the root cause is available in the Apache Tomcat/7.0.62 logs.




fileStructure.jpg
[Thumbnail for fileStructure.jpg]
file structure
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!