-
Feature Request
-
Resolution: Done
-
Major
-
3.0.1.Final
-
None
When using RESTEasy in WildFly, the javax.validation.Validator is eagerly retrieved during deployment (in ValidatorContextResolver#getContext().
This may cause RESTEasy to pick up a not properly configured validator which does not integrate with CDI. This can be avoided by not passing the validator but the ValidatorFactory to the newly created GeneralValidatorImpl and obtaining an validator only when it is actually used (upon resource method invocation). This is safe because after the deployment has finished, any validator obtained from the WildFly ValidatorFactory is correctly configured (e.g. its validators integrate with CDI if CDI is enabled).
If no validator can be retrieved, an exception should be raised since the integration between JAX-RS and Bean Validation is mandatory under Java EE (currently an exception is logged but the application works, only without validation functionality).