问题描述
本人准备做小项目自己玩玩。却出现这样的问题.环境配置:eclipse3.2.1+myeclipse5.5+tomcat5.5,tomcat启动没有问题。访问login.jsp就出如下问题!看错误像是找不到FacesServlet,但是j2ee自带的jar中已经包含,jsf-api.jar,jsf-impl.jar两个包,commons-digester.jar这个是自己加进去的!错误如下!typeExceptionreportmessagedescriptionTheserverencounteredaninternalerror()thatpreventeditfromfulfillingthisrequest.exceptionjavax.servlet.ServletException:Wrappercannotfindservletclassjavax.faces.webapp.FacesServletoraclassitdependsonorg.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(Thread.java:595)rootcausejava.lang.ClassNotFoundException:javax.faces.webapp.FacesServletorg.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1355)org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1201)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(Thread.java:595)noteThefullstacktraceoftherootcauseisavailableintheApacheTomcat/5.5.20logs.web.xml配置<?xmlversion="1.0"encoding="UTF-8"?><web-appversion="2.5"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/javaeehttp://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"><servlet><servlet-name>facesContext</servlet-name><servlet-class>javax.faces.webapp.FacesServlet</servlet-class><!--<load-on-startup>1</load-on-startup>--></servlet><servlet-mapping><servlet-name>facesContext</servlet-name><url-pattern>*.jsp</url-pattern></servlet-mapping><welcome-file-list><welcome-file>login.jsp</welcome-file></welcome-file-list><listener></listener></web-app>
解决方案
解决方案二:
javax.faces.webapp.FacesServletJSF的包在classpath中没有找到.应该放到WEB-INF/lib下.
解决方案三:
jsf包已经在buildpath的javaeelibraries里了
解决方案四:
引用1楼bruni的回复:
javax.faces.webapp.FacesServletJSF的包在classpath中没有找到.应该放到WEB-INF/lib下.
正解java.lang.ClassNotFoundException:javax.faces.webapp.FacesServlet这里也提示了找不到FacesServlet的class文件
解决方案五:
javax.faces.webapp.FacesServlet没有加入JSF的JAR包,
解决方案六:
引用4楼ilysony的回复:
javax.faces.webapp.FacesServlet没有加入JSF的JAR包,
不是说了吗?jsf包被j2ee引进去了!
解决方案七:
我也遇到了同样的错,http://babyblue2004.bokee.com/5733663.html这里提供了方法,不过,我只是把<load-on-starup>1</load-on-starup>给删除就好了,你可以试试。
解决方案八:
我也是新手,我是不知道怎么运行!
解决方案九:
我也是,在web。xml中删除那个<load-on-starup>1</load-on-starup>