0

I am working on a spring application which put the uploaded the file in a server path and update the details in the table. But getting error while uploading the file as below,

[ERROR   ] SRVE0777E: Exception thrown by application class 

'org.springframework.web.servlet.FrameworkServlet.processRequest:948'
org.springframework.web.util.NestedServletException: 

Request processing failed; nested exception is org.springframework.web.multipart.MultipartException: Could not parse multipart servlet request; nested exception is 

org.apache.commons.fileupload.FileUploadException: Connection closed: Read failed.  Possible end of stream encountered. 
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:948)
    at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:838)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
    at [internal classes]
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
    at [internal classes]
    at org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125)
    at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:207)
    at [internal classes]

And my controller method is follows

@RequestMapping(params = "action=uploadfile", method = RequestMethod.POST) 
public ModelAndView uploadParameters(@ModelAttribute("uploadParametersForm") 
UploadParameterFormBean uploadParamForm, HttpServletRequest request, 
HttpServletResponse response) { 
ModelAndView modelAndView = null; 
modelAndView = buildModelAndView(request, uploadParamForm); 
FulfillmentParameterService parameterService = 
parameterServiceFactory.getParameterServiceObj(uploadParamFo‌​
rm.getParamType()); parameterService.uploadParameters(uploadParamForm); 
return modelAndView; 
}
Muthu vignesh k
  • 237
  • 1
  • 4
  • 19
  • whats your controller method handler signature? – Vikas Suryawanshi Jun 12 '17 at 07:02
  • Below is my controller method, – Dablu Gupta Jun 12 '17 at 08:32
  • @RequestMapping(params = "action=uploadfile", method = RequestMethod.POST) public ModelAndView uploadParameters(@ModelAttribute("uploadParametersForm") UploadParameterFormBean uploadParamForm, HttpServletRequest request, HttpServletResponse response) { ModelAndView modelAndView = null; modelAndView = buildModelAndView(request, uploadParamForm); FulfillmentParameterService parameterService = parameterServiceFactory.getParameterServiceObj(uploadParamForm.getParamType()); parameterService.uploadParameters(uploadParamForm); return modelAndView; } – Dablu Gupta Jun 12 '17 at 08:33

0 Answers0