I was able to solve this in JBoss AS 7 by specifying the providers and resources manually in my Application class. By default, when you do not override the getClasses() method, JBoss would automatically scan for every provider and resource. By overriding this method, JBoss disables automatic scanning and I was able to specify every single provider/resource except the 3rd party one I wanted to exclude.
To ease the pain of having to specify every single resource class, I used a library called reflections to dynamically lookup my custom resource classes which I keep all in the same package. Here's 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));
}
}