私はエラーキャッチひどく苦労しています:Grailsの中で "org.springframework.web.multipart.MultipartExceptionを" CACHする方法3
org.springframework.web.multipart.MultipartException
Iを
def upload = { UploadTextCommand ->
...code...
}
:
さらに
final class UploadTextCommand {
MultipartFile contents
static constraints = {
}
}
が、私はこのアクションを持っているファイルのポストを処理するために、次のコードを持っています10
私はエラーを強制的に「application.yml」ファイルでこれらの設定を持っている:
controllers:
upload:
maxFileSize: 100
maxRequestSize: 100
だから私は確実に例外を再作成することができますが、ブラウザは恐ろしい図を示している前に、私はそれをキャッチすることはできません:
HTTP Status 500 - Request processing failed;
nested exception is org.springframework.web.multipart.MultipartException
Grailsでこのエラーをキャッチする方法を教えてください。アップロードアクションでtry/catchを使用するだけで、悲惨に失敗します。コメント投稿者の要望に応じて
を追加しましたスタックトレース:
javax.servlet.ServletException: org.springframework.web.multipart.MultipartException: Could not parse multipart servlet request; nested exception is java.lang.IllegalStateException: org.apache.tomcat.util.http.fileupload.FileUploadBase$SizeLimitExceededException: the request was rejected because its size (318635) exceeds the configured maximum (100000)
grails.plugin.cache.web.filter.AbstractFilter.logThrowable(AbstractFilter.java:116)
grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:70)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:101)
org.grails.web.servlet.mvc.GrailsWebRequestFilter.doFilterInternal(GrailsWebRequestFilter.java:73)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:101)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:101)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:101)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:101)
org.springframework.boot.context.web.ErrorPageFilter.doFilter(ErrorPageFilter.java:113)
org.springframework.boot.context.web.ErrorPageFilter.forwardToErrorPage(ErrorPageFilter.java:188)
org.springframework.boot.context.web.ErrorPageFilter.handleException(ErrorPageFilter.java:171)
org.springframework.boot.context.web.ErrorPageFilter.doFilter(ErrorPageFilter.java:135)
org.springframework.boot.context.web.ErrorPageFilter.access$000(ErrorPageFilter.java:61)
org.springframework.boot.context.web.ErrorPageFilter$1.doFilterInternal(ErrorPageFilter.java:95)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
org.springframework.boot.context.web.ErrorPageFilter.doFilter(ErrorPageFilter.java:113)
このエラーの詳細なスタックトレースを表示できますか。 –
@MichalSzulcスタックトレースを追加しました。 –