Announcement Announcement Module
Collapse
No announcement yet.
Why is Spring MVC auto retrying POST requests when file is attached? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Why is Spring MVC auto retrying POST requests when file is attached?

    I'm getting some strange behavior with my web application and I can't seem to figure out what's going on.

    The problem is that whenever the controller takes more than a certain time to respond, for some reason it retries (based on how long it's taking). The first attempt was with a file upload, but then commenting out everything in my controller and only having:

    Code:
    Thread.currentThread().sleep(60000);
    I noticed in the logs that something was still POSTing requests continuously until the Thread was done.

    I'm not sure if it matters but here's my form:

    HTML Code:
    <form action="/w/upload" method="post" enctype="multipart/form-data" >
        Select a file: <input type="file" name="videoFileData" />
        <input type="submit" value="Upload" />
    </form>
    I tested POSTing with NO file attached and it worked (controller received only 1 request), but with a file uploaded in the request the controller got two requests.

    Am I missing some sort of config?

    logs

    Code:
    02:18:22.570::o.s.w.s.DispatcherServlet::DEBUG::DispatcherServlet with name 'DispatcherServlet' processing POST request for [/w/upload]
    02:18:22.621::o.s.w.m.c.CommonsMultipartResolver::DEBUG::Found multipart file [videoFileData] of size 3773872 bytes with original filename [VID_20130505_184912.mp4], stored at [/Users/gumatias/Work/code/ownits/ownits/ownits-skate-uploader/target/work/upload_78f4071c_b8dc_4923_a723_ae9c9d7eaf82_00000003.tmp]
    02:18:22.624::o.s.w.s.m.m.a.RequestMappingHandlerMapping::DEBUG::Looking up handler method for path /upload
    02:18:22.624::o.s.w.s.m.m.a.RequestMappingHandlerMapping::DEBUG::Returning handler method [public org.springframework.web.servlet.ModelAndView com.ownits.uploader.web.controller.UploadController.handleRequest(com.ownits.uploader.web.form.UploadForm) throws java.lang.Exception]
    02:18:22.624::o.s.b.f.s.DefaultListableBeanFactory::DEBUG::Returning cached instance of singleton bean 'uploadController'
    02:18:22.635::c.o.u.w.c.UploadController::INFO ::Uploading video...
    02:18:52.572::o.s.w.s.DispatcherServlet::DEBUG::DispatcherServlet with name 'DispatcherServlet' processing POST request for [/w/upload]
    02:18:52.602::o.s.w.m.c.CommonsMultipartResolver::DEBUG::Found multipart file [videoFileData] of size 3773872 bytes with original filename [VID_20130505_184912.mp4], stored at [/Users/gumatias/Work/code/ownits/ownits/ownits-skate-uploader/target/work/upload_78f4071c_b8dc_4923_a723_ae9c9d7eaf82_00000007.tmp]
    02:18:52.602::o.s.w.s.m.m.a.RequestMappingHandlerMapping::DEBUG::Looking up handler method for path /upload
    02:18:52.602::o.s.w.s.m.m.a.RequestMappingHandlerMapping::DEBUG::Returning handler method [public org.springframework.web.servlet.ModelAndView com.ownits.uploader.web.controller.UploadController.handleRequest(com.ownits.uploader.web.form.UploadForm) throws java.lang.Exception]
    02:18:52.602::o.s.b.f.s.DefaultListableBeanFactory::DEBUG::Returning cached instance of singleton bean 'uploadController'
    02:18:52.603::c.o.u.w.c.UploadController::INFO ::Uploading video...
    02:19:22.637::c.o.u.w.c.UploadController::INFO ::Done uploading video
    02:19:22.637::o.s.w.s.DispatcherServlet::DEBUG::Rendering view [org.springframework.web.servlet.view.JstlView: name 'upload'; URL [/WEB-INF/views/master/upload.jsp]] in DispatcherServlet with name 'DispatcherServlet'
    02:19:22.637::o.s.w.s.v.JstlView::DEBUG::Added model object 'org.springframework.validation.BindingResult.uploadForm' of type [org.springframework.validation.BeanPropertyBindingResult] to request in view with name 'upload'
    02:19:22.637::o.s.w.s.v.JstlView::DEBUG::Added model object 'uploadForm' of type [com.ownits.uploader.web.form.UploadForm] to request in view with name 'upload'
    02:19:22.637::o.s.w.s.v.JstlView::DEBUG::Forwarding to resource [/WEB-INF/views/master/upload.jsp] in InternalResourceView 'upload'
    02:19:22.638::o.a.t.i.BasicTilesContainer::DEBUG::Render request recieved for definition 'upload'
    02:19:22.639::o.s.w.m.c.CommonsMultipartResolver::DEBUG::Cleaning up multipart file [videoFileData] with original filename [VID_20130505_184912.mp4], stored at [/Users/gumatias/Work/code/ownits/ownits/ownits-skate-uploader/target/work/upload_78f4071c_b8dc_4923_a723_ae9c9d7eaf82_00000003.tmp]
    02:19:22.639::o.s.w.s.DispatcherServlet::DEBUG::Successfully completed request
    02:19:52.603::c.o.u.w.c.UploadController::INFO ::Done uploading video
    02:19:52.604::o.s.w.s.DispatcherServlet::DEBUG::Rendering view [org.springframework.web.servlet.view.JstlView: name 'upload'; URL [/WEB-INF/views/master/upload.jsp]] in DispatcherServlet with name 'DispatcherServlet'
    02:19:52.604::o.s.w.s.v.JstlView::DEBUG::Added model object 'org.springframework.validation.BindingResult.uploadForm' of type [org.springframework.validation.BeanPropertyBindingResult] to request in view with name 'upload'
    02:19:52.604::o.s.w.s.v.JstlView::DEBUG::Added model object 'uploadForm' of type [com.ownits.uploader.web.form.UploadForm] to request in view with name 'upload'
    02:19:52.604::o.s.w.s.v.JstlView::DEBUG::Forwarding to resource [/WEB-INF/views/master/upload.jsp] in InternalResourceView 'upload'
    02:19:52.604::o.a.t.i.BasicTilesContainer::DEBUG::Render request recieved for definition 'upload'
    02:19:52.605::o.s.w.m.c.CommonsMultipartResolver::DEBUG::Cleaning up multipart file [videoFileData] with original filename [VID_20130505_184912.mp4], stored at [/Users/gumatias/Work/code/ownits/ownits/ownits-skate-uploader/target/work/upload_78f4071c_b8dc_4923_a723_ae9c9d7eaf82_00000007.tmp]
    02:19:52.605::o.s.w.s.DispatcherServlet::DEBUG::Successfully completed request
    Last edited by gumatias; Jun 19th, 2013, 01:23 AM.
Working...
X