java.lang.ClassNotFoundException: javax.servlet.http.Part
我在获取要上传的文件的名字时出现下列错误,我已经引用了javax.servlet.http.Part包,希望帮忙解决一下。java错误 --------------------编程问答--------------------
严重: Allocate exception for servlet BaseServlet
java.lang.ClassNotFoundException: javax.servlet.http.Part
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
at java.lang.Class.getDeclaredMethods(Class.java:1791)
at org.apache.catalina.util.DefaultAnnotationProcessor.processAnnotations(DefaultAnnotationProcessor.java:226)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1153)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:827)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:879)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:617)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1760)
at java.lang.Thread.run(Thread.java:619)
顶一下 --------------------编程问答-------------------- 你的包没引用到吧。 --------------------编程问答-------------------- jar包 --------------------编程问答-------------------- Tomcat7才有这个吧 --------------------编程问答--------------------
我使用的是java EE 6 Libraries ,已经包含javax.servlet.jar,里面也有javax.servlet.http 还有Part.class.
补充:Java , Java EE