首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Exception >

jsp smartupload 组件出现异常:javax.servlet.ServletException: java.lang.NoClassDefFound

2014-01-26 
在使用jspsmartupload 上传文件时在 su.initialize(pagecontext)这一行出现了异常: 不知道引起这个异常的原


在使用jsp  smartupload 上传文件时在


su.initialize(pagecontext)这一行出现了异常:


不知道引起这个异常的原因是什么


Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:505)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:398)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)


root cause

javax.servlet.ServletException: java.lang.NoClassDefFoundError: javax rvlet/jsp/PageContext
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:852)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
org.apache.jsp.upload_jsp._jspService(upload_jsp.java:129)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)


root cause

java.lang.NoClassDefFoundError: javax rvlet/jsp/PageContext
com.jspsmart.upload.SmartUpload.initialize(SmartUpload.java:73)
org.apache.jsp.upload_jsp._jspService(upload_jsp.java:69)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)


root cause

java.lang.ClassNotFoundException: javax.servlet.jsp.PageContext
java.net.URLClassLoader$1.run(URLClassLoader.java:200)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(URLClassLoader.java:188)
sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229)
java.lang.ClassLoader.loadClass(ClassLoader.java:307)
java.lang.ClassLoader.loadClass(ClassLoader.java:252)
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
com.jspsmart.upload.SmartUpload.initialize(SmartUpload.java:73)
org.apache.jsp.upload_jsp._jspService(upload_jsp.java:69)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)

------解决方法--------------------------------------------------------
java.lang.ClassNotFoundException: javax.servlet.jsp.PageContext

太奇怪了,难道jsp.jar 以及 servlet.jar这2个文件不存在吗?还是.....

看看你项目的WEB-INF/lib 目录,删除那些和tomcat有冲突的,或者重复的jar

------解决方法--------------------------------------------------------
su.initialize(pagecontext);

这里面是放这个对象吗?


SmartUpload su = new SmartUpload();
su.initialize(getServletConfig(),request,response);

        

热点排行