commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 35147] - [digester] Class.getClassLoader() is not reliable
Date Thu, 02 Jun 2005 02:36:53 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=35147>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=35147





------- Additional Comments From skitching@apache.org  2005-06-02 04:36 -------
I suggest using false for the "initialise" parameter of Class.forName only
because that is the closest equivalent to ClassLoader.loadClass(name), which
doesn't initialise the classes it loads.

But Class.forName(name) and Class.getResource(name) are definitely *not*
equivalent to the classloader versions. They are for *you* because you only have
one level of classloader (null). But consider the behaviour in a web application
running within a container like Tomcat, where the digester library is loaded via
a shared classloader and the user classes are loaded via a webapp-specific
classloader...in that case, the line of code
   Class.forName("x")
within a Digester class will try to load x via the shared classloader, not the
webapp-specific classloader.

See also method Digester.setClassLoader(loader).

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message