I have Jersey resource class A calling a method in resource class B.Both classes have a @Context ServletContext servletContext at the class level. When I instantiate class B
You can instantiate class B using ResourceContext. I.e. in class A you can have:
@Context private ResourceContext rc;
And then in you can instantiate resource B as follows:
B resourceB = rc.getResource(B.class);
See ResourceContext javadoc for more info.