delegate: false
repositories:
/WEB-INF/classes/
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@1af33d6
java.lang.ClassNotFoundException:
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1083)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:806)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
2016-6-26 9:12:40 org.apache.catalina.core.StandardWrapperValve invoke
严重: Allocate exception for servlet hello
java.lang.ClassNotFoundException:
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1083)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:806)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
2016-6-26 9:12:41 org.apache.catalina.core.StandardWrapperValve invoke
信息: Servlet hello is currently unavailable
2016-6-26 9:12:41 org.apache.catalina.core.StandardWrapperValve invoke
信息: Servlet hello is currently unavailable
2016-6-26 9:12:41 org.apache.catalina.core.StandardWrapperValve invoke
信息: Servlet hello is currently unavailable
2016-6-26 9:12:42 org.apache.catalina.core.StandardWrapperValve invoke
信息: Servlet hello is currently unavailable
2016-6-26 9:12:42 org.apache.catalina.core.StandardWrapperValve invoke
信息: Servlet hello is currently unavailable
2016-6-26 9:12:42 org.apache.catalina.core.StandardWrapperValve invoke
信息: Servlet hello is currently unavailable
2016-6-26 9:12:42 org.apache.catalina.core.StandardWrapperValve invoke
信息: Servlet hello is currently unavailable
解决:
网上搜了几种解决方案:
1、关掉myeclipse,把原来的tomcat换掉,如果是安装版的就卸载,重新放一个tomcat,启动myeclipse,配置tomcat,部署,再启动tomcat,一切OK。
2、之前jar包我是通过Build path -> Configure build path-> Add External JARs的方式添加的,程序编译,Tomcat启动都很正常,没有错误。可是一访问jsp页面就报上述错误。 苦思不得其解,但看了错误信息说是找不到org.springframework.web.servlet.DispatcherServlet类,所以我就干脆将spring.jar,spring-webmvc.jar等jar包通通手工添加到/WEB-INF/lib目录下,并且将default output folder值改为projectName/WebContent/WEB-INF/classes 问题就得以解决了。
这两种解决方案试了都不行,但是大体了解到可能是jar包没有导入进去,所以进了eclipse的工程目录,找到对应的存放jar包的目录:.metadata\.plugins\org.eclipse.wst.server.core\tmp3\wtpwebapps\jsf2nd\WEB-INF\lib,发现果然少了两个jar包,将之放入后问题就解决了。
错误原因:至今未能查明究竟是哪个地方出错了才使得eclipse不能将jar包放到eclipse的tomcat插件下面。
可能的几个原因:
1、我的eclipse选择的默认编译是jdk1.5,而这个项目用的是Tomcat6,
2、我的Eclipse里面默认设置的tomcat的编译器也是1.5