-
Bug
-
Resolution: Done
-
Major
-
3.0.10.Final
-
None
-
-
Workaround Exists
-
-
Low
See attached sample small project test.zip.
Bug is about using built-in @javax.validation.constraints.Min constraint annotation for validating my custom type: resteasy.bug.showcase.params.IntParam but only when configuring validation within @Provider class. Hibernate-validator cannot find my validator when request is valid - but in the same time can find it when a request is invalid.
javax.validation.UnexpectedTypeException: HV000030: No validator could be found for type: resteasy.bug.showcase.params.IntParam at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintValidatorManager.verifyResolveWasUnique(ConstraintValidatorManager.java:218) at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintValidatorManager.findMatchingValidatorClass(ConstraintValidatorManager.java:193) at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintValidatorManager.getInitializedValidator(ConstraintValidatorManager.java:97) at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateConstraints(ConstraintTree.java:125) at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateConstraints(ConstraintTree.java:91) at org.hibernate.validator.internal.metadata.core.MetaConstraint.validateConstraint(MetaConstraint.java:83) at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:547) at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForDefaultGroup(ValidatorImpl.java:487) at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:451) at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:403) at org.hibernate.validator.internal.engine.ValidatorImpl.validate(ValidatorImpl.java:206) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.jboss.weld.bean.proxy.AbstractBeanInstance.invoke(AbstractBeanInstance.java:38) at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:100) at org.jboss.weld.proxies.Validator$976505265$Proxy$_$$_WeldClientProxy.validate(Unknown Source) at resteasy.bug.showcase.resources.AdminEndpoint.getAdmins(AdminEndpoint.java:28)