I'm getting:
javax.validation.ValidationException: HV000032: Unable to initialize org.hibernate.validator.internal.constraintvalidators.bv.PatternValidator
My pom.xml
:
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.1.0.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>5.2.2.Final</version>
</dependency>
No other error is showing, even with debug-mode logging.
@Pattern(regexp = "[0-9.- ]*"); here is the code
The error you are getting is due to your regexp being invalid. To solve it you need change your regexp to something really basic:
@Pattern(regexp = "[0-9]*");
Then gradually add the extra characters to spot what is causing the error. It could be two dashes or the space, but you can easily test it.
The issue with your regexp here is with dash used inside of it. Put dash at the beginning:
@Pattern(regexp = "[-0-9. ]*");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With