When a web app based around jersey is deployed, numerous warnings are generated,
one for each resource method implemented of the following:
WARNING: WEB9052: Unable to load class getError, reason:
where getError is actually a web resource method.
The problem occurs because Jersey declares it interest in the javax.ws.rs.Path
annotation which can be applied to both classes and methods. Unfortunately when
building up the interest list in
ServletContainerInitializerUtil::checkAgainstInterestList(lines 406-471) it
assumes that all entries tagged as such are actually classes and tries to load
them, which fails for methods with a ClassNotFoundException. A simple fix for
this is would be to test if the annotatedElement (ae) is an instanceOf Type
before attempting to load the class file. In addition, it may be a necessity to
load the parent class if ae is an instance of a method or field.