commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brad Wetmore <Bradford.Wetm...@Sun.COM>
Subject Re: [httpclient] about bad_record_mac; Solved
Date Fri, 25 Mar 2005 22:00:06 GMT

> On the production machine it was a common-httpclient.jar in the 

I assuming this points to <java-home>/lib/ext, and that we're talking 
about standard extensions.

> And the classLoader was not loading the SecureProtocolSocketFactory from 
> my jar but from this common-httpclient.jar in the J2RE_LIBRARY/ext
> I have deleted common-httpclient.jar in the J2RE_LIBRARY/ext and now it 
> works.
> I really have difficulties to understand how classLoader works. I am 
> comming from C language, with .a static it was simple, with dynamic .so 
> it is still possible to understand. But here I really don't understand.
> When I am launching the appli I do :
> java -jar myjar.jar
> So I don't understand why this stupid loader go get anything in 
> J2RE_LIBRARY/ext and use it with higher priority than elements in my jar.

The short answer is that Java searches/loads bootstrap classes (, 
java.lang, etc) first, then classes found in the extensions directory, 
before loading user classes (i.e. -classpath).  The extensions directory 
is kind of a "second" system classes area.

Have a look at the classloader info for the extension mechanism.

or have a look at the Java 2 Platform Security book 
(Gong/Elison/Dageforde) section 4 on secure classloaders for much more 
detailed info on the actual class search/load mechanism.

The classloading mechanism including the classloader hierarchy and 
delegation model is too hard to explain in a quick email.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message