Welcome! Log In Create A New Profile

Advanced

request was rejected because its size (3277304) exceeds the configured maximum (2000000)

Posted by Sunny Thakur 
Hello,

We have a application is jsp which is running on tomcat and using nginx as a front. Now what was happening while uploading the file using application the error thrown by nginx on web browser was "413 Request Entity Too Large". So what i did i add below lines in virtual host file.

client_body_in_file_only clean;
client_body_buffer_size 128K;
client_max_body_size 5M;
sendfile on;
send_timeout 900s;
keepalive_timeout 300;

Then error was fixed, but now what is happening while uploading 3-4 Mb size file browser keep uploading the file and after sometime a blank page appears with below error in log files.

[ERROR] 04:58:32 ErrorHandler - Error encountered
org.springframework.web.multipart.MaxUploadSizeExceededException: Maximum upload size of 2000000 bytes exceeded; nested exception is org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException: the request was rejected because its size (4358439) exceeds the configured maximum (2000000)
at org.springframework.web.multipart.commons.CommonsMultipartResolver.parseRequest(CommonsMultipartResolver.java:160)
at org.springframework.web.multipart.commons.CommonsMultipartResolver.resolveMultipart(CommonsMultipartResolver.java:139)
at org.springframework.web.servlet.DispatcherServlet.checkMultipart(DispatcherServlet.java:1020)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:883)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException: the request was rejected because its size (4358445) exceeds the configured maximum (2000000)
at org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.<init>(FileUploadBase.java:914)
at org.apache.commons.fileupload.FileUploadBase.getItemIterator(FileUploadBase.java:331)
at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:349)
at org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:126)
at org.springframework.web.multipart.commons.CommonsMultipartResolver.parseRequest(CommonsMultipartResolver.java:156)
... 55 more

Please help me on this
Re: request was rejected because its size (3277304) exceeds the configured maximum (2000000)
February 01, 2013 01:58PM
Sunny Thakur Wrote:
-------------------------------------------------------
> at java.lang.Thread.run(Thread.java:722)
> Caused by:
> org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededExceptio
> n: the request was rejected because its size (4358445) exceeds the
> configured maximum (2000000)

This looks like a tomcat error and not a nginx issue.
Thanks for the reply...
Is there any settings in tomcat for enabling File upload or file limit.

As i tested the same on my windows machine with same setup and no blank page is displaying.....It just show the above mentioned error on the browser where as in Linux [CentOS 6.2 x64] it shows blanks page and the error is displaying in log file.
Re: request was rejected because its size (3277304) exceeds the configured maximum (2000000)
February 02, 2013 06:11AM
Trow this "org.apache.commons.fileupload SizeLimitExceededException" into google, plenty of solutions.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 47
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready