tomcat服务外网地址文件上传失败

在本地上传文件是正常的,但访问外网链接,上传文件报错:

Caused by: org.apache.commons.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. null
	at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:351)
	at org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:115)
	at org.springframework.web.multipart.commons.CommonsMultipartResolver.parseRequest(CommonsMultipartResolver.java:158)
	... 38 more
Caused by: java.net.SocketTimeoutException
	at org.apache.tomcat.util.net.NioBlockingSelector.read(NioBlockingSelector.java:201)
	at org.apache.tomcat.util.net.NioSelectorPool.read(NioSelectorPool.java:235)
	at org.apache.tomcat.util.net.NioSelectorPool.read(NioSelectorPool.java:216)
	at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.fillReadBuffer(NioEndpoint.java:1280)
	at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.read(NioEndpoint.java:1223)
	at org.apache.coyote.http11.Http11InputBuffer.fill(Http11InputBuffer.java:729)
	at org.apache.coyote.http11.Http11InputBuffer.access$300(Http11InputBuffer.java:40)
	at org.apache.coyote.http11.Http11InputBuffer$SocketInputBuffer.doRead(Http11InputBuffer.java:1084)
	at org.apache.coyote.http11.filters.IdentityInputFilter.doRead(IdentityInputFilter.java:140)
	at org.apache.coyote.http11.Http11InputBuffer.doRead(Http11InputBuffer.java:263)
	at org.apache.coyote.Request.doRead(Request.java:581)
	at org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:326)
	at org.apache.catalina.connector.InputBuffer.checkByteBufferEof(InputBuffer.java:642)
	at org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:349)
	at org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:183)
	at java.io.FilterInputStream.read(FilterInputStream.java:133)
	at org.apache.commons.fileupload.util.LimitedInputStream.read(LimitedInputStream.java:134)
	at org.apache.commons.fileupload.MultipartStream$ItemInputStream.makeAvailable(MultipartStream.java:999)
	at org.apache.commons.fileupload.MultipartStream$ItemInputStream.read(MultipartStream.java:903)
	at java.io.InputStream.read(InputStream.java:101)
	at org.apache.commons.fileupload.util.Streams.copy(Streams.java:100)
	at org.apache.commons.fileupload.util.Streams.copy(Streams.java:70)
	at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:347)
	... 40 more

解决:修改tomcat的server.xml,

    

添加 disableUploadTimeout="false"

你可能感兴趣的:(tomcat)