I almost spent a day trying to understand why my unit test case was able to load a resource where as once I deploy the jar failed to load the same. In the end I came across something very basic : Some.class.getResource behaves differently than Some.class.getClassLoader.getResource. There is no simple answer like use this always. It depends on which class loaded loading that particular class. So if you are facing such issue try checking both options.
TIP : Having issues with loading classpath resources using java ?