I was able to solve this problem in JBoss AS 7 by specifying the suppliers and resources manually in the Application class. By default, when you do not override the getClasses () method, JBoss will automatically scan each provider and resource. By overriding this method, JBoss disables automatic scanning, and I was able to specify every provider / resource, except for the third party that I wanted to exclude.
To ease the pain of specifying each individual resource class, I used the reflections library to dynamically search for my custom resource classes that I keep in one package. Here is my solution:
@ApplicationPath("/") public class MyApplication extends Application { @Override public Set<Class<?>> getClasses() { final Set<Class<?>> classes = new HashSet<>(); addResources(classes, "my.package.containing.resources"); return classes; } private void addResources(final Set<Class<?>> classes, final String pkg) { classes.addAll(new Reflections(pkg, new SubTypesScanner(), new TypeAnnotationsScanner()).getTypesAnnotatedWith(Path.class)); } }
source share