Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-899

javax.validation.Validator shouldn't be retrieved eagerly

    XMLWordPrintable

Details

    • Feature Request
    • Resolution: Done
    • Major
    • 3.0.2.Final
    • 3.0.1.Final
    • jaxrs
    • None

    Description

      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).

      Attachments

        Activity

          People

            rsigal@redhat.com Ronald Sigal
            gunnar.morling Gunnar Morling
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: