Announcement Announcement Module
Collapse
No announcement yet.
Spring MVC 3.1 exception: An Errors/BindingResult argument is expected to be ... Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring MVC 3.1 exception: An Errors/BindingResult argument is expected to be ...

    Hello,

    I upgraded to Spring 3.1.1.RELEASE, and now I'm getting an exception on the following method:

    Code:
    @RequestMapping(method = RequestMethod.POST, params = "_finish")
    public ModelAndView doPostFinish(@PathVariable("runEnvironmentName") RunEnvironment pEnvironment, @ModelAttribute("command") JobSpecNewCommand pCommand, BindingResult pErrors) 
    {
    ...
    }
    Throws the following exception:

    java.lang.IllegalStateException: An Errors/BindingResult argument is expected
    to be immediately after the model attribute argument in the controller method
    signature:

    java.lang.IllegalStateException: An Errors/BindingResult argument is expected to be immediately after the model attribute argument in the controller method signature: public org.springframework.web.servlet.ModelAndView de.wwag.infra.oocsd.projectAdmin.fe.natures.hudson .jobspecs.RunEnvJobSpecNewController.doPostFinish( de.wwag.infra.oocsd.projectAdmin.common.domain.Run Environment,de.wwag.infra.oocsd.projectAdmin.fe.na tures.hudson.jobspecs.JobSpecNewCommand,org.spring framework.validation.BindingResult)
    at org.springframework.web.method.annotation.ErrorsMe thodArgumentResolver.resolveArgument(ErrorsMethodA rgumentResolver.java:62) ...
    As you can see the method signature is as expected. The BindingResult argument is declared after the model attribute.

    In the same class the following method is declared:

    Code:
    @ModelAttribute("otherJobSpecs")
    public List<JobReference> modelOtherJobSpecs(@PathVariable("runEnvironmentName") RunEnvironment pEnvironment, @ModelAttribute("command") JobSpecNewCommand pCommand) 
    {
    ...
    }
    When I remove the method from the class, everything works as expected.

    Any ideas?

  • #2
    It's a bug in Spring SPR-9378"

    Comment

    Working...
    X