tomcat启动报错 java.lang.ClassNotFoundException: org.apache.jsp.index_jsp
项目运行一直很平稳,但是换了tomcat之后打开jsp网页时就报错,描述如下:
1. 错误描述
打开jsp网页时报错
java.lang.NullPointerException
org.apache.jsp.WEB_002dINF.pages.imagecheck.test_jsp._jspInit(test_jsp.java:22)
或 java.lang.ClassNotFoundException: org.apache.jsp.index_jsp
2. 原因
由于tomcat 和 项目 中都有 servlet-api.jar 和 jsp-api.jar,换了tomcat之后,tomcat中的jar版本及编译的jdk版本不同,导致冲突
版本查看,请看下图
Manifest-Version: 1.0 Ant-Version: Apache Ant 1.8.4 Created-By: 1.6.0_45-b06 (Sun Microsystems Inc.) X-Compile-Source-JDK: 1.6 X-Compile-Target-JDK: 1.6 Name: javax/servlet/jsp/ Specification-Title: Java API for JavaServer Pages Specification-Version: 2.2 Specification-Vendor: Sun Microsystems, Inc. Implementation-Title: javax.servlet.jsp Implementation-Version: 2.2.FR Implementation-Vendor: Apache Software Foundation