6 Replies Latest reply on Jan 24, 2013 8:35 AM by Mathieu Lachance

    Resteasy hibernatevalidator provider not picked up as jboss module

    Andrei Serea Newbie

      Hello everyone!


      I have been trying for the past 2 days to create a basic setup with jax-rs and the validation api.

      I used Jbos AS 7.1.1, resteasy jaxrs, and hibernate validator.


      Adding the hibernate validator provider to my war's lib directory solves this problem easily.


      But what I wanted to do and I seem to have a problem accomplishing is loading the resteasy hibernate validator provider as a MODULE in Jboss AS.


      Here's my module.xml file:


      {code:xml}<module xmlns="urn:jboss:module:1.1" name="org.jboss.resteasy.resteasy-hibernatevalidator-provider">


              <resource-root path="resteasy-hibernatevalidator-provider-2.3.2.Final.jar"/>




              <module name="javax.api"/>

              <module name="javax.enterprise.api"/>

              <module name="javax.servlet.api"/>

              <module name="javax.ws.rs.api"/>

                          <module name="javax.validation.api"/>

                          <module name="org.jboss.resteasy.resteasy-jaxrs"/>

                          <module name="org.hibernate.validator"/>




      If I add a dependency to this module using MANIFEST.MF Dependencies entry, resteasy doesn't pickup the provider and the validation is not triggered (but I can see from the logs that the module is processed and added to my war as part of the deployment). Even more, I can do something like:

      {code:java}Class<?> clazz = Class.forName("org.jboss.resteasy.plugins.validation.hibernate.HibernateValidatorContextResolver");{code}

      and get the class inside my app.


      If I add the dependency as a global module in standalone.xml, resteasy picks up the provider and validation is called.


      Can someone explain why it doesn't work with the Dependencies entry?