为什么我上传的时候 报错,导入老师的代码运行也一样

来源:3-1 使用SmartUpload实现文件批量上传

qq_脚本

2015-08-02 17:07

java.lang.NullPointerException: charsetName

at java.lang.String.<init>(String.java:442)

at com.jspsmart.upload.SmartUpload.upload(SmartUpload.java:234)

at com.imooc.servlet.SmartUploadServlet.doPost(SmartUploadServlet.java:44)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)

at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)

at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)

at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)

at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)

at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2466)

at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2455)

at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

at java.lang.Thread.run(Thread.java:619)


写回答 关注

2回答

  • 谢同学谢童鞋
    2016-05-08 11:19:33

    老师的代码没有将smartUpload的jar包复制过来,不知道是不是这个原因

  • Cirunger
    2015-12-14 21:51:39

    NullPointerException   去调试这个看看

Java中的文件上传下载

由简入深,轻松实现文件上传下载功能及相关框架的使用

77391 学习 · 337 问题

查看课程

相似问题