I am using jersey.
this is my jboss-deployment-structure:
<?xml version="1.0" encoding="UTF-8" ?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<deployment>
<exclusions>
<module name="org.jboss.resteasy.resteasy-atom-provider" />
<module name="org.jboss.resteasy.resteasy-cdi" />
<module name="org.jboss.resteasy.resteasy-jaxrs" />
<module name="org.jboss.resteasy.resteasy-jaxb-provider" />
<module name="org.jboss.resteasy.resteasy-jackson-provider" />
<module name="org.jboss.resteasy.resteasy-jsapi" />
<module name="org.jboss.resteasy.resteasy-multipart-provider" />
<module name="org.jboss.resteasy.async-http-servlet-30" />
<module name="javax.ws.rs.api" />
</exclusions>
<exclude-subsystems>
<subsystem name="resteasy" />
<subsystem name="webservices" />
<subsystem name="jaxrs" />
</exclude-subsystems>
</deployment>
</jboss-deployment-structure>
This alone does not work. I had to comment
<resource-root path="jboss-jaxrs-api_1.1_spec-1.0.1.Final-redhat-2.jar"/>
in
jbossHOME\modules\system\layers\base\javax\ws\rs\api\main\module.xml.
Now the rest service works fine, but by commenting the line, i am disabling resteasy for every application in the server! and that's a hack, not a proper solution. Is there a decent way to disable resteasy just for a given application without touching the general server configuration?
thanks
In JBoss 6 or 7 AS resteasy is loaded as a dependency module by the JavaEE module. Most of the time people get stuck here as we can not exclude JavaEE. However it's possible to exclude JavaEE and include the modules JavaEE is supposed to load except the one's we don't need.
For more details you can check here Foolproof method of excluding resteasy...
Sample jboss-deployment-structure.xml from the same place (Goes in WEB-INF/) :