u010584063
shine--he
2015-03-20 06:21

tomcat或jdk版本问题,导致java.io.FileNotFoundException

  • jdk
  • java
  • tomcat
  • 文件上传

用apache的httpclient上传文件到另一个服务器,使用tomcat7+jdk1.7当文件名为中文时报下面这个异常,用tomcat7+jdk1.8则不管中英文都会报这个错,用tomcat8+jdk1.8则正常,但是我现在项目里面只能用tomcat7,求朋友们帮助了

java.io.FileNotFoundException: /home/saas/lmsgogogo/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/harison-web/dynamic/upload1/file/20150320/1426830469824024052.pdf" (没有那个文件或目录)

at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:131)
at org.apache.http.entity.mime.content.FileBody.writeTo(FileBody.java:92)
at org.apache.http.entity.mime.HttpMultipart.doWriteTo(HttpMultipart.java:206)
at org.apache.http.entity.mime.HttpMultipart.writeTo(HttpMultipart.java:224)
at org.apache.http.entity.mime.MultipartEntity.writeTo(MultipartEntity.java:183)
at org.apache.http.entity.HttpEntityWrapper.writeTo(HttpEntityWrapper.java:89)
at org.apache.http.impl.client.EntityEnclosingRequestWrapper$EntityWrapper.writeTo(EntityEnclosingRequestWrapper.java:108)
at org.apache.http.impl.entity.EntitySerializer.serialize(EntitySerializer.java:117)
at org.apache.http.impl.AbstractHttpClientConnection.sendRequestEntity(AbstractHttpClientConnection.java:265)
at org.apache.http.impl.conn.ManagedClientConnectionImpl.sendRequestEntity(ManagedClientConnectionImpl.java:203)
at org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:236)
at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:121)
at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:685)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:487)
at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:863)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:106)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:57)
at lms.common.utils.FileSystemUtil.uploadFile(FileSystemUtil.java:51)
at lms.modules.fileSystem.filter.FileFilter.mergerFile(FileFilter.java:176)
at lms.modules.fileSystem.filter.FileFilter.access$0(FileFilter.java:151)
at lms.modules.fileSystem.filter.FileFilter$1.run(FileFilter.java:133)
  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答