Q:

Hibernate validator doesn't work

Im trying to use hibernate validator in my spring mvc project with a html form. It compiles correctly but when I put put the wrong text in the form input, hibernate doesn't detect that, the BindingResult has no erros. 
Im using java 8 with Tomcat 9.0. Here is my code:
The class that I want to validate:
 private int id;
private String jugador;

@NotNull(message = "No puede estar vacio")
@Size(min = 1, max = 16, message = "...")
private String contra;

@NotNull(message = "No puede estar vacio")
@Size(min = 1, max = 16, message = "...")
@Email
private String email;

The controller:
@RequestMapping("/procesarRegistro")
public String procesarRegistro(@Valid @ModelAttribute("Cuenta") Cuenta cuenta, BindingResult bindingResult){
    //This is allways false (idk why)
    if(bindingResult.hasErrors()){
        return "registrarse";
    }
}

The html form:
<form:form action="procesarRegistro" name="reg" modelAttribute="Cuenta" cssClass="login" cssStyle="margin-top: 4%; margin-left: 40%; margin-right: 40%; border-radius: 3%; background: #fff;">
        <div class = "contenedorLogin">
            <div class = "input-contenedor">
                <form:input path="jugador" placeHolder = "Nombre de minecraft" value = "" cssClass="textLog" cssStyle="text-align: left;"></form:input><br>
                <form:input path= "id" placeHolder = "Numero de cuenta" cssClass="textLog" cssStyle="text-align: left;"></form:input><br>
                <form:input path="email" placeHolder = "email" cssClass="textLog" cssStyle="text-align: left;"></form:input><br>
                    <form:errors path = "email"></form:errors>
                <form:password path="contra" placeHolder = "Tu contraseña" value = "" cssClass="textLog" cssStyle="text-align: left;"></form:password><br>
                    <form:errors path = "contra"></form:errors>
                <input type="text" value="confirmar">

                <input type="password" name="contra2" placeholder="Confirmar" value = "" class = "textLog" style="text-align: left;"><br><br>
            </div>

            <input type="submit" value = "Registrarse" class = "botonLog">
            <p style="text-align: center; color: gray;">Si tienes alguna duda entra al servidor de minecraft y pon /cuenta</p>
        </div>
    </form:form>

Im using the 5.4.3 version of hibernate validator (I have tried 7.0, 6.1 and 6.0). Here is a photo of my jar files:

Thanks for reading, i would be so pleased if someone can help me :)

A:

prueba de utilizar el validador @NotBlank. Es probable que te esté llegando un valor "" en vez de nulo. Para mayor control utiliza los dos validador es juntos @NotNull y @NotBlank. Espero te ayude

