在tomcat中的lib里面存放的是tomcat所需要的jar包,在项目的web-inf里面的lib存放了项目的jar,当两个里面有相同jar包的时候,就会发生冲突,但是日志中却不体现,启动日志如下:
2016-2-3 17:48:24 org.apache.catalina.core.AprLifecycleListener init信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/jdk1.6.0_20/jre/lib/amd64/server:/usr/java/jdk1.6.0_20/jre/lib/amd64:/usr/java/jdk1.6.0_20/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib2016-2-3 17:48:24 org.apache.coyote.http11.Http11Protocol init信息: Initializing Coyote HTTP/1.1 on http-80882016-2-3 17:48:24 org.apache.catalina.startup.Catalina load信息: Initialization processed in 443 ms2016-2-3 17:48:24 org.apache.catalina.core.StandardService start信息: Starting service Catalina2016-2-3 17:48:24 org.apache.catalina.core.StandardEngine start信息: Starting Servlet Engine: Apache Tomcat/6.0.182016-2-3 17:48:24 org.apache.catalina.startup.HostConfig deployWAR信息: Deploying web application archive dcwj.war2016-2-3 17:48:31 org.apache.coyote.http11.Http11Protocol start信息: Starting Coyote HTTP/1.1 on http-80882016-2-3 17:48:31 org.apache.jk.common.ChannelSocket init信息: JK: ajp13 listening on /0.0.0.0:80492016-2-3 17:48:31 org.apache.jk.server.JkMain start信息: Jk running ID=0 time=0/20 config=null2016-2-3 17:48:31 org.apache.catalina.startup.Catalina start信息: Server startup in 7159 ms
处理这种情况可以删除掉项目中与tomcat中相同的jar,比如tomcat中的el-api.jar,servlet-api.jar,jsp-api.jar,在项目中可能名字会有差异,但是只要是带el,servlet,jsp的jar就可以尝试着删除。删除前最好备份,可以对比tomcat中的jar进行删除。