title: spring mvc javax.validation.UnexpectedTypeException: No validator could be found for type: java.lang.String
body: <p>I try to use the validators for the first time with Spring MVC and I always get the exception:</p>
  
  <pre><code>javax.validation.UnexpectedTypeException: No validator could be found for type: java.lang.String
      at org.hibernate.validator.engine.ConstraintTree.verifyResolveWasUnique(ConstraintTree.java:236)
      at org.hibernate.validator.engine.ConstraintTree.findMatchingValidatorClass(ConstraintTree.java:219)
      at org.hibernate.validator.engine.ConstraintTree.getInitializedValidator(ConstraintTree.java:167)
      at org.hibernate.validator.engine.ConstraintTree.validateConstraints(ConstraintTree.java:113)
      at org.hibernate.validator.metadata.MetaConstraint.validateConstraint(MetaConstraint.java:121)
      at org.hibernate.validator.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:334)
  </code></pre>
  
  <p>Here is my annoted class for validation:</p>
  
  <pre><code>public class AbstractEmployeDto implements Employable, Comparable&lt;AbstractEmployeDto&gt; {
  
  private Set&lt;AbstractClientDto&gt; listeClients = new TreeSet&lt;AbstractClientDto&gt;();
  
  private Long id;
  
  @NotEmpty
  private String nom;
  
  @NotEmpty
  private String prenom;
  
  @DateTimeFormat(pattern="dd/MM/yyyy")
  @Past
  private String dateNaissance;
  
  @Size(min=10)
  private String telephone;
  
  @Email
  private String email;
  
  private TypeEmploye typePersonne;
  
  private String rue;
  
  @Size(min=4, max=4)
  private String npa;
  
  getter and setter ...
  </code></pre>
  
  <p>And the controller with the annotation @valid:</p>
  
  <pre><code>@RequestMapping(value = "/saveNew", method = RequestMethod.POST)  
      public ModelAndView saveNewEmploye(@ModelAttribute("command") @Valid AbstractEmployeDto employe,   
         BindingResult result) { 
          Map&lt;String, Object&gt; model = new HashMap&lt;String, Object&gt;();
          if(result.hasErrors()){
              return new ModelAndView("/employes/add.html", model);  
          }
  ...
  </code></pre>