title: Spring annotation based validation is not working
body: <p>I am using Spring 4.x for my application. There i have some rest api exposed and i want to validate the request body json using annotations. But the validations are not getting triggered. Code Snippets of my service:</p>
  <ol>
  <li>I am using @Validated Annotation from springframework validation package at class level of service.</li>
  </ol>
  <pre><code>@Validated
  @Api(value=&quot;Sample Rest service&quot;)
  @Path(&quot;/test&quot;)
  public class testService{
  .....
  }
  </code></pre>
  <ol start="2">
  <li>In the request method, i am using @Valid annotation on request body:</li>
  </ol>
  <pre><code>@POST
  @Path(&quot;/sample&quot;)
  public Response createResource(@Valid @RequestBody Resource res){
  .....
  }
  </code></pre>
  <ol start="3">
  <li>In the POJO class of Resource, i have just added @NotNull annotation for a field which has public setters and getters.</li>
  </ol>
  <pre><code>public class Resource{
  @NotNull(message=&quot;Name can't be null&quot;)
  private String name;
  .....
  }
  </code></pre>
  <p>But it is not triggering any validation error.I am not using spring boot or jpa framework in my application.
  Please let me know what am I missing?</p>