Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-6709

JSR-303 @Valid validation is not invoked for @RequestBody controller method arguments

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: 3.0 GA
    • Fix Version/s: 3.1 M2
    • Component/s: Web
    • Labels:
      None

      Description

      If an argument to a Spring MVC Controller method is annotated with both the @RequestBody and @Valid annotations, the argument should be passed to the validation framework after being populated, but the validation is not invoked.

      More details and an example are included in the forum thread.

        Activity

        Hide
        scottyfred Scott Frederick added a comment -

        I don't see anything to indicate that the combination of @Valid and @RequestBody is the source of the ZipException, but there isn't very much information here to go on. I suggest posting your problem, with as much detail as possible, to the Web section of the Spring Forum: http://forum.springsource.org/forumdisplay.php?25-Web.

        Show
        scottyfred Scott Frederick added a comment - I don't see anything to indicate that the combination of @Valid and @RequestBody is the source of the ZipException, but there isn't very much information here to go on. I suggest posting your problem, with as much detail as possible, to the Web section of the Spring Forum: http://forum.springsource.org/forumdisplay.php?25-Web .
        Hide
        puneetpandey37 Puneet Pandey added a comment -

        Scott: I too couldn't see any relation between Validation annotations and ZipException. Unfortunately, however, I was getting the exception only when I was changing the Spring version. I could process a little further but couldn't get the issue resolved completely. Will post the issue in Springsource forum too. Thanks!

        Show
        puneetpandey37 Puneet Pandey added a comment - Scott: I too couldn't see any relation between Validation annotations and ZipException. Unfortunately, however, I was getting the exception only when I was changing the Spring version. I could process a little further but couldn't get the issue resolved completely. Will post the issue in Springsource forum too. Thanks!
        Show
        puneetpandey37 Puneet Pandey added a comment - Hi Scott: Posted the issue to the SpringSource: http://forum.springsource.org/showthread.php?135923-Spring3-MVC-annotation-driven-Rest-Services-in-OSGi-environment-bean-validation-issue&p=441701#post441701
        Hide
        olivergierke Oliver Gierke added a comment -

        An exception like this usually indicates corrupted JAR files. Have you tried purging your local Maven repo (or equaivalent) and re-grabbing the binaries?

        Show
        olivergierke Oliver Gierke added a comment - An exception like this usually indicates corrupted JAR files. Have you tried purging your local Maven repo (or equaivalent) and re-grabbing the binaries?
        Hide
        puneetpandey37 Puneet Pandey added a comment -

        Oliver: You are correct, it was actually a case of corrupted jar. I have actually progressed and deployed the code to the Virgo Server. But, still could not get it to work. Have posted the issue to the SpringSource. Please have a look into it and suggest.

        Link:

        http://forum.springsource.org/showthread.php?135923-Spring3-MVC-annotation-driven-Rest-Services-in-OSGi-environment-bean-validation-issue&p=441701#post441701

        Show
        puneetpandey37 Puneet Pandey added a comment - Oliver: You are correct, it was actually a case of corrupted jar. I have actually progressed and deployed the code to the Virgo Server. But, still could not get it to work. Have posted the issue to the SpringSource. Please have a look into it and suggest. Link: http://forum.springsource.org/showthread.php?135923-Spring3-MVC-annotation-driven-Rest-Services-in-OSGi-environment-bean-validation-issue&p=441701#post441701

          People

          • Assignee:
            rstoya05-aop Rossen Stoyanchev
            Reporter:
            scottyfred Scott Frederick
            Last updater:
            Puneet Pandey
          • Votes:
            26 Vote for this issue
            Watchers:
            30 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Days since last comment:
              2 years, 14 weeks, 2 days ago