即時通訊使用SPring引導開發我的系統,但上傳超過1MB(使用多部分文件類型)的文件時出現此異常。任何人都可以解釋給我嗎?謝謝多部分文件超出限制異常
java.lang.IllegalStateException:多部分MIME部分文件超過最大文件大小 在org.eclipse.jetty.util.MultiPartInputStreamParser $ MultiPart.write(MultiPartInputStreamParser.java:111)〜[碼頭-UTIL-9.2 .14.v20151106.jar:9.2.14.v20151106] at org.eclipse.jetty.util.MultiPartInputStreamParser.parse(MultiPartInputStreamParser.java:681)〜[jetty-util-9.2.14.v20151106.jar:9.2.14 .v20151106] at org.eclipse.jetty.util.MultiPartInputStreamParser.getParts(MultiPartInputStreamParser.java:400)〜[jetty-util-9.2.14.v20151106.jar:9.2.14.v20151106] at org.eclipse.jetty .server.Request.getParts(Request.java:2146)〜[jetty-server-9.2.14.v20151106.jar:9.2.14.v20151106] 在org.eclipse.jetty.server.Request.extractMultipartParameters(Request.java:386)〜[jetty-server-9.2.14.v20151106.jar:9.2.14.v20151106] at org.eclipse.jetty.server。 Request.extractContentParameters(Request.java:309)〜[jetty-server-9.2.14.v20151106.jar:9.2.14.v20151106] at org.eclipse.jetty.server.Request.extractParameters(Request.java:257) 〜[jetty-server-9.2.14.v20151106.jar:9.2.14.v20151106] at org.eclipse.jetty.server.Request.getParameter(Request.java:826)〜[jetty-server-9.2.14。 v20151106.jar:9.2.14.v20151106] at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:70)〜[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)〜[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.eclipse.jetty.servlet.ServletHandler $ CachedChain.doFilter(ServletHandler.java:1652)〜[jetty-servlet-9.2.14.v20151106.jar:9.2.14.v20151106] at org.springframework.web。 filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121)〜[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java: 107)〜[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.eclipse.jetty.servlet.ServletHandler $ CachedChain.doFilter(ServletHandler.java:1652)〜[jetty-servlet- 9.2.14.v20151106.jar:9.2.14.v20151106] at org.springframework.boot.actuate.autoconfigure.MetricsFilter.doFilterInternal(MetricsFilter.java:103)〜[spring-boot-actuator-1.3.1.RELEASE。 jar:1.3.1.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.jav a:107)〜[spring-web-4.2.4.RELEASE.jar:4.2.4.RELEASE] at org.eclipse.jetty.servlet.ServletHandler $ CachedChain.doFilter(ServletHandler.java:1652)〜[jetty- servlet-9.2.14.v20151106.jar:9.2.14.v20151106] at vn.com.splussoftware.sms.config.OAuth2AuthenticationFilter.doFilter(OAuth2AuthenticationFilter.java:71)〜[bin /:na] at org.eclipse .jetty.servlet.ServletHandler $ CachedChain.doFilter(ServletHandler.java:1652)〜[jetty-servlet-9.2.14.v20151106.jar:9.2.14.v20151106] at org.eclipse.jetty.servlet.ServletHandler.doHandle (ServletHandler.java:585)[jetty-servlet-9.2.14.v20151106.jar:9.2.14.v20151106] at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)[jetty -server-9.2.14.v20151106.jar:9.2.14.v20151106] at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577) [jetty-security-9.2.14.v20151106.jar:9.2.14.v20151106] at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)[jetty-server-9.2.14。 v20151106.jar:9.2.14.v20151106] at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)[jetty-server-9.2.14.v20151106.jar:9.2.14.v20151106 ] at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)[jetty-servlet-9.2.14.v20151106.jar:9.2.14.v20151106] at org.eclipse.jetty.server。 session.SessionHandler.doScope(SessionHandler.java:185)[jetty-server-9.2.14。v20151106.jar:9.2.14.v20151106] at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)[jetty-server-9.2.14.v20151106.jar:9.2.14.v20151106 ] at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)[jetty-server-9.2.14.v20151106.jar:9.2.14.v20151106] at org.eclipse.jetty。 server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)[jetty-server-9.2.14.v20151106.jar:9.2.14.v20151106] at org.eclipse.jetty.server.Server.handle(Server.java :499)[jetty-server-9.2.14.v20151106.jar:9.2.14.v20151106] at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)[jetty-server-9.2.14 .v20151106.jar:9.2.14.v20151106] at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)[jetty-server-9.2.14.v20151106.jar:9.2.14.v20151106] at org.eclipse.jetty.io.AbstractConnection $ 2.run(AbstractConnection.java:544)[jetty-io-9.2.14.v20151106.jar:9.2.14.v20151106] at org.eclipse.jetty.util。 thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)[jetty-util-9.2.14.v20151106.jar:9.2.14.v20151106] at org.eclipse.jetty.util.thread.QueuedThreadPool $ 3.run(QueuedThreadPool。的java:555)[碼頭-UTIL-9.2.14.v20151106.jar:9.2.14.v20151106] 在java.lang.Thread.run(未知來源)[NA:1.8.0_66]
謝謝先生,它直接解決我的問題,但我可以將其配置爲無限嗎?像-1(是啊-1是無限的,我試過) –
對於其他人從谷歌來到這裏,最新的文檔指出,唯一需要的屬性是:'spring.http.multipart.max-file-size'。 – ndtreviv
看來這些屬性已經移動了一下。這對我有用: 'spring.http.multipart.maxFileSize:20MB spring.http.multipart.maxRequestSize:20MB' –