qq_25867659
qq_25867659
采纳率0%
2019-05-26 20:33 阅读 652

Java上传文件时出错,求大神帮助

5

上传文件时,文件能上传,就是报了一个错误,错误代码如下:

java.io.IOException: java.io.FileNotFoundException: E:\intelli IDEA\IntelliJ IDEA 2019.1.2.IntelliJIdea\system\tomcat\Unnamed_Potato_3\work\Catalina\localhost\ROOT\upload_153e9ccf_dc34_49cf_8013_597e0454a311_00000009.tmp (系统找不到指定的文件。)
at org.apache.catalina.core.ApplicationPart.write(ApplicationPart.java:122)
at com.potato.util.FileUpload.UpUpload(FileUpload.java:57)
at com.potato.servlet.uploadFile.doPost(uploadFile.java:27)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at com.potato.Filter.FilterEncoding.doFilter(FilterEncoding.java:32)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:509)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1104)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2508)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2497)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.FileNotFoundException: E:\intelli IDEA\IntelliJ IDEA 2019.1.2.IntelliJIdea\system\tomcat\Unnamed_Potato_3\work\Catalina\localhost\ROOT\upload_153e9ccf_dc34_49cf_8013_597e0454a311_00000009.tmp (系统找不到指定的文件。)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.(FileInputStream.java:138)
at org.apache.tomcat.util.http.fileupload.disk.DiskFileItem.write(DiskFileItem.java:392)
at org.apache.catalina.core.ApplicationPart.write(ApplicationPart.java:120)
... 28 more

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

3条回答 默认 最新

  • dabocaiqq dabocaiqq 2019-05-26 21:46
  • weixin_39827826 治愈君 2019-05-27 10:32

    报错不是很明显吗? upload_153e9ccf_dc34_49cf_8013_597e0454a311_00000009.tmp 这个文件找不到啊,自己看看代码

    点赞 评论 复制链接分享
  • weixin_44969271 Mr,D先生 2019-05-27 15:17

    你可以根据路径看一下找不到的文件是怎么回事,用debug测一下。

    点赞 评论 复制链接分享

相关推荐