2 luozhichao1992 luozhichao1992 于 2014.05.30 21:37 提问

java.lang.NoClassDefFoundError: javax/servlet/Servlet
jsp

tomcat6.0和MyEclipse发布网站服务端,总是报这个错误,百度了很多方法都没有解决掉问题,求帮助
type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: java.lang.NoClassDefFoundError: javax/servlet/Servlet
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:268)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root cause

java.lang.NoClassDefFoundError: javax/servlet/Servlet
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClass(Unknown Source)
java.security.SecureClassLoader.defineClass(Unknown Source)
java.net.URLClassLoader.defineClass(Unknown Source)
java.net.URLClassLoader.access$100(Unknown Source)
java.net.URLClassLoader$1.run(Unknown Source)
java.net.URLClassLoader$1.run(Unknown Source)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(Unknown Source)
java.lang.ClassLoader.loadClass(Unknown Source)
java.lang.ClassLoader.loadClass(Unknown Source)
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClass(Unknown Source)
java.security.SecureClassLoader.defineClass(Unknown Source)
java.net.URLClassLoader.defineClass(Unknown Source)
java.net.URLClassLoader.access$100(Unknown Source)
java.net.URLClassLoader$1.run(Unknown Source)
java.net.URLClassLoader$1.run(Unknown Source)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(Unknown Source)
java.lang.ClassLoader.loadClass(Unknown Source)
……………………

2个回答

kevin_Luan
kevin_Luan   2014.06.15 15:51

从错误描述中就可以知道是找不到类:javax.servlet.Servlet
java.lang.NoClassDefFoundError: javax/servlet/Servlet
检查下应该是缺少Servlet Api Jar包

qwuack
qwuack   2014.06.26 20:56

1、缺少Servlet-api.jar文件

2、jar包冲突。

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!
其他相关推荐
Spark java.lang.NoClassDefFoundError: javax/servlet/FilterRegistration问题
今天希望在Java Web项目中调用Spark,运行Spark程序,在运行的过程中遇到 java.lang.NoClassDefFoundError: javax/servlet/FilterRegistration错误,经过网上查找都说是包冲突的问题,经过确认,在pom.xml中删除所有的javax.servlet相关的dependence 但运行程序仍然有错误,通过mvn dependen
java.lang.NoClassDefFoundError: javax/servlet/ServletInputStream
如果在你所在开发过程中出现了:java.lang.NoClassDefFoundError: javax/servlet/ServletInputStreamfileupload.FileUpload.doPost(FileUpload.java:36)javax.servlet.http.HttpServlet.service(HttpServlet.java:717)jav
java.lang.NoClassDefFoundError: javax/servlet/ServletContext
错误: java.lang.NoClassDefFoundError: javax/servlet/ServletContext at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) at java.lan
Java.lang.NoClassDefFoundError: javax/servlet/SessionCookieConfig
Spring4单元测试出现错误: Java.lang.NoClassDefFoundError: javax/servlet/SessionCookieConfig查看下pom.xml中, 正确的dependency<dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifac
idea报java.lang.NoClassDefFoundError: javax/servlet/http/HttpServletRequest
在启动springBoot时候 报了那个错误 因为idea需要配置tomcat 在启动的时候设置下 Defalut--->tomcat server -->local 然后启动tomcat再运行ok
ideallij之Exception in thread "main" java.lang.NoClassDefFoundError: javax/servlet/Filter
spring boot项目在eclipse能够启动,但是当你忍受不了eclipse或sts的慢时, 激情澎湃的将项目用ideallij启动时,有没有遇到这个磨人的小妖精: Exception in thread "main" java.lang.NoClassDefFoundError: javax/servlet/Filter ...... 是不是很纳闷,为什么eclipse跑得
异常信息:java.lang.NoClassDefFoundError: javax/servlet/SessionCookieConfig
java.lang.NoClassDefFoundError: javax/servlet/SessionCookieConfig at org.springframework.test.context.web.AbstractGenericWebContextLoader.configureWebResources(AbstractGenericWebContextLoader.java:20
java.lang.NoClassDefFoundError: javax/servlet/SessionCookieConfig 原因分析与解决方案
Spring4单元测试出现错误: java.lang.NoClassDefFoundError: javax/servlet/SessionCookieConfig  原因分析: Spring4 与servlet2.5兼容性问题 解决方案: pom.xml中添加servlet 3.0.1, scope填写test,artifactId为javax.sevlet-api
Exception in thread "main" java.lang.NoClassDefFoundError: javax/servlet/Filter
Mac idea 编译运行eclipse创建的 spring-boot工程报错:Exception in thread "main" java.lang.NoClassDefFoundError: javax/servlet/Filter解决方法,在对应的module下添加tomcat lib下面的jar包
pentaho项目中报错java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener
严重: Error configuring application listener of class org.pentaho.platform.web.http.context.HsqldbStartupListener java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener  at java.lang.Cla