As I have set maximum file upload limit,I am getting
org.apache.tomcat.util.http.fileupload.FileUploadBase$FileSizeLimitExceededException: The field file exceed
Add a special exception handler into your Controller:
@ExceptionHandler(FileSizeLimitExceededException.class)
public YourReturnType uploadedAFileTooLarge(FileSizeLimitExceededException e) {
/*...*/
}
(If this does not work, you have to enable exception handling in your configuration. Normally Spring does this by default.)