title: Jersey: How to share ExceptionMapper among several web modules?
body: <p>My exception mapper classes work perfectly when it's located inside the .war package. The problem is that I have several .war packages which share the same exception hierarchy. I'm thinking to put my exception mapper classes into a utility jar and put them into "/lib" folder of the application server. This utility jar already contains classes of my custom exceptions. It turns out that Jersey can't find my exception mapper classes once they are putted outside of .war package.</p>
  
  <p>Is there a way to enable Jersey scanning providers located in "/lib" folder? </p>
  
  <p>BTW, my application server is "JBoss AS 6.0" and I'm using Jersey SpringServlet. Here is my web.xml configuration snippet:</p>
  
  <pre><code>    &lt;servlet&gt;
      &lt;servlet-name&gt;Jersey Web Application&lt;/servlet-name&gt;
      &lt;servlet-class&gt;com.sun.jersey.spi.spring.container.servlet.SpringServlet&lt;/servlet-class&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;com.sun.jersey.config.property.packages&lt;/param-name&gt;
          &lt;param-value&gt;
              com.sample.rest
          &lt;/param-value&gt;
      &lt;/init-param&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;com.sun.jersey.api.json.POJOMappingFeature&lt;/param-name&gt;
          &lt;param-value&gt;true&lt;/param-value&gt;
      &lt;/init-param&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;Jersey Web Application&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;       
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>Cheers!</p>