vlad_roubtsov
(member)
08/14/03 07:45 PM
Re: ClassPath conflict

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.



Contact us JavaWorld

Powered by UBB.threads™ 6.5.5

Featured White Papers


RESEARCH CENTERS: Java Standard Edition | Java Enterprise Edition | Java Micro Edition | Development Tools
About Us | Advertise | Contact Us | Terms of Service/Privacy
Copyright, 2006-2008 Network World, Inc. All rights reserved.