在启动tomcat以后,控制台发现“Offending class: javax/servlet/Servlet.class”信息:
Using CATALINA_HOME: "D:\apache-tomcat-7.0.52"
Using CATALINA_TMPDIR: "D:\apache-tomcat-7.0.52\temp"
Using JRE_HOME: "D:\jdk1.7.0_51"
Using CLASSPATH: "D:\apache-tomcat-7.0.52\bin\bootstrap.jar;D:\apache-tomcat-7.0.52\bin\tomcat-juli.jar"
二月 28, 2014 10:30:50 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-bio-8080"]
二月 28, 2014 10:30:50 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["ajp-bio-8009"]
二月 28, 2014 10:30:50 下午 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 931 ms
二月 28, 2014 10:30:50 下午 org.apache.catalina.core.StandardService startInternal
信息: Starting service Catalina
二月 28, 2014 10:30:50 下午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/7.0.52
二月 28, 2014 10:30:50 下午 org.apache.catalina.startup.HostConfig deployDescriptor
信息: Deploying configuration descriptor C:\Documents and Settings\XXX\.IntelliJIdea11\system\tomcat\Unnamed_myapp\conf\Catalina\localhost\ROOT.xml
二月 28, 2014 10:30:50 下午 org.apache.catalina.loader.WebappClassLoader validateJarFile
信息: validateJarFile(E:\code\MyApp\target\MyApp\WEB-INF\lib\servlet-api-3.0-alpha-1.jar) - jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/servlet/Servlet.class
log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
根据提示,在网上搜了一下Servlet Spec 3.0,10.7.2章节:
Furthermore, the ClassLoader instance MUST be a separate instance for each deployed web application.
这个问题的原因是是webapp中WEB-INFO/lib下,有重复的servlet包。将servlet包从webapp的部署文件中删除以后。再启动,错误信息就消失了。
转载于:https://my.oschina.net/roxor/blog/603287