Announcement Announcement Module
Collapse
No announcement yet.
Batch admin "POST not supported" error Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Batch admin "POST not supported" error

    I have embedded spring batch admin into our webapp and am successfully able to list executions, however when I try to stop a running execution I get a 404 error and the below log message:

    Code:
    13:20:26,989 INFO  [STDOUT] 13:20:26:989 [http-127.0.0.1-8080-1] WARN  org.springframework.web.servlet.PageNotFound - Request method 'POST' not supported
    I am using spring-batch-admin ver 1.2.0.RELEASE running in JBoss 4.3

    My investigations so far seem to indicate that the AnnotationMethodHandlerAdapter bean is ignoring the JobExecutionController.stopAll method. I suspect that this might be because the @ReuquestMapping specifies the DELETE method (see below), and the web ui is submitting the form using POST (see below html), however that fact that nobody else is complaining of this indicates that it is something in my setup that is causing this.

    Code:
    	@RequestMapping(value = "/jobs/executions", method = RequestMethod.DELETE)
    	public @ModelAttribute("jobExecutions")
    	Collection<JobExecutionInfo> stopAll(ModelMap model, @RequestParam(defaultValue = "0") int startJobExecution,
    			@RequestParam(defaultValue = "20") int pageSize) {
    Code:
    <form action="/crt/admin/jobs/executions" method="POST">
    	<input type="hidden" name="_method" value="DELETE"/>	
    	<input id="stop" type="submit" value="Stop&nbsp;All" name="stop" />
    </form>
    My questions are:
    • Am I looking in the right place?
    • Is there anywhere else I should be investigating?
    • Is there any component that changes the request method from POST to DELETE?

    Any help or pointers appreciated

    Thanks

    Jake

  • #2
    There needs to be a HiddenMethodFilter in your web.xml (standard Spring MVC feature). If you used the one from the sample or from the spring-batch-admin-resources jar it should be there already.

    Comment


    • #3
      That worked. Thanks for the quick response

      Jake

      Comment

      Working...
      X