|
|
|||||||
|
A lot depends on what that CallingClass.class is. If it was loaded by a classloader that is above the web classloader in the hierarchy then loading any web app resource will of course fail. This is because Class.getResourceXXX() methods use the classloader that is the defining loader for the class they were called on, not the caller's current loader. In my article I suggest using either the thread context loader or, better yet, techniques like in Find a way out of the ClassLoader maze. This could be quite complicated, I can't be more specific without seeing the actual code. |