title: [HV000030: No validator could be found for constraint 'javax.validation.constraints.NotEmpty' validating type 'java.lang.String'
body: <p>I want to underline that I already searched for this kind of problem but couldn't find a solution for my case.
  In my Spring Boot webapp I keep getting this error when validating beans using @NotEmpty or @NotBlank annotation of package javax.validation.constraints:</p>
  
  <pre><code>14:04:59,426 ERROR [org.springframework.boot.web.servlet.support.ErrorPageFilter] (default task-33) Forwarding to error page from request [/registrati
  on] due to exception [HV000030: No validator could be found for constraint 'javax.validation.constraints.NotEmpty' validating type 'java.lang.String'.
   Check configuration for 'username']: javax.validation.UnexpectedTypeException: HV000030: No validator could be found for constraint 'javax.validation
  .constraints.NotEmpty' validating type 'java.lang.String'. Check configuration for 'username'
          at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.throwExceptionForNullValidator(ConstraintTree.java:229)
          at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.getConstraintValidatorNoUnwrapping(ConstraintTree.java:310)
          at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.getConstraintValidatorInstanceForAutomaticUnwrapping(Constraint
  Tree.java:244)
  </code></pre>
  
  <p>No errors if I use @NotNull annotation, but this is not the desired behavior because it allows for blank fields.
  These are my pom.xml dependencies:</p>
  
  <pre><code>    &lt;parent&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
          &lt;version&gt;2.0.4.RELEASE&lt;/version&gt;
          &lt;relativePath/&gt; &lt;!-- lookup parent from repository --&gt;
      &lt;/parent&gt;
  
      &lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;project.reporting.outputEncoding&gt;UTF-8&lt;/project.reporting.outputEncoding&gt;
          &lt;java.version&gt;1.8&lt;/java.version&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-data-jpa&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-security&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-thymeleaf&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
            &lt;groupId&gt;nz.net.ultraq.thymeleaf&lt;/groupId&gt;
            &lt;artifactId&gt;thymeleaf-layout-dialect&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
              &lt;exclusions&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                      &lt;artifactId&gt;spring-boot-starter-tomcat&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
              &lt;/exclusions&gt;
          &lt;/dependency&gt;
         &lt;dependency&gt;
             &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
             &lt;artifactId&gt;spring-boot-starter-batch&lt;/artifactId&gt;
         &lt;/dependency&gt;
         &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
              &lt;artifactId&gt;javax.servlet-api&lt;/artifactId&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.mariadb.jdbc&lt;/groupId&gt;
              &lt;artifactId&gt;mariadb-java-client&lt;/artifactId&gt;
              &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
              &lt;artifactId&gt;spring-security-test&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.google.code.gson&lt;/groupId&gt;
              &lt;artifactId&gt;gson&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;!-- https://mvnrepository.com/artifact/net.sourceforge.nekohtml/nekohtml --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;net.sourceforge.nekohtml&lt;/groupId&gt;
              &lt;artifactId&gt;nekohtml&lt;/artifactId&gt;
              &lt;version&gt;1.9.21&lt;/version&gt;&lt;!--$NO-MVN-MAN-VER$--&gt;
          &lt;/dependency&gt;
  
          &lt;!-- webjars --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.webjars&lt;/groupId&gt;
              &lt;artifactId&gt;bootstrap&lt;/artifactId&gt;
              &lt;version&gt;4.1.3&lt;/version&gt;
              &lt;exclusions&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;org.webjars&lt;/groupId&gt;
                      &lt;artifactId&gt;jquery&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
              &lt;/exclusions&gt;
          &lt;/dependency&gt;
  
          &lt;!-- https://mvnrepository.com/artifact/org.webjars/datatables --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.webjars&lt;/groupId&gt;
              &lt;artifactId&gt;datatables&lt;/artifactId&gt;
              &lt;version&gt;1.10.19&lt;/version&gt;
              &lt;exclusions&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;org.webjars&lt;/groupId&gt;
                      &lt;artifactId&gt;jquery&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
              &lt;/exclusions&gt;
          &lt;/dependency&gt;
  
  
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;!-- plugin&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
              &lt;/plugin --&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
  
  &lt;/project&gt;
  </code></pre>
  
  <p>I see that hibernate validator is working because if I don't use any @NotEmpty nor @NotBlank annotation, other annotations such as @Size are working correctly.</p>
  
  <p>In my bean I'm importing javax.validation.constraints.
  When starting up my JBoss, following line about hibernate validator appears:</p>
  
  <pre><code>14:04:17,676 INFO  [org.hibernate.validator.internal.util.Version] (background-preinit) HV000001: Hibernate Validator 5.3.5.Final-redhat-2
  </code></pre>
  
  <p>This is not the same version as the hibernate-validator 6.0.11 jar that is resolved by Maven.</p>
  
  <p>What's happening? Maybe some dependency conflict?</p>
  
  <p>Thanks to everyone that could help me.</p>