RE: [logging] parent-first classloaders

2005-03-10 Thread Sharples, Colin

 I don't know much about classloaders, but I was working with the
 WebSphere administration console today and I noticed a drop down for
 choosing parent-first or child-first classloaders.

There's quite a good description of WebSphere's classloader policies at:
http://tinyurl.com/6l98v

Also follow the Class loaders link in Related concepts at the bottom

Colin Sharples
IBM Advisory IT Specialist
Email: sharples-at-nz.ibm.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [logging] parent-first classloaders

2005-03-09 Thread matthew.hawthorne
Simon Kitching wrote:
 You mentioned in your page on JCL
 (http://www.qos.ch/logging/classloader.jsp):
 
 quote
 Jake also keeps reminding us on the log4j-dev mailing list that the
 child-parent delegation model is not the only model out there and that
 parent-first delegation model is alive and well.
 /quote
 
 Are you able to provide the names of some frameworks that use
 parent-first classloading? I'm curious to find out whether these are
 large + well-used frameworks or whether these are experimental and/or
 obsolete systems.


You probably already know this, but I think most containers give the
option to use parent-first, if so desired.

I don't know much about classloaders, but I was working with the
WebSphere administration console today and I noticed a drop down for
choosing parent-first or child-first classloaders.

So, there may be a situation where a developer is forced to work with a
parent-first configuration, whether it's considered a good thing or not.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [logging] parent-first classloaders

2005-03-09 Thread Simon Kitching
On Thu, 2005-03-10 at 16:25 +1300, Simon Kitching wrote:
 Hi Ceki,
 
 You mentioned in your page on JCL
 (http://www.qos.ch/logging/classloader.jsp):
 
 quote
 Jake also keeps reminding us on the log4j-dev mailing list that the
 child-parent delegation model is not the only model out there and that
 parent-first delegation model is alive and well.
 /quote
 
 Are you able to provide the names of some frameworks that use
 parent-first classloading? I'm curious to find out whether these are
 large + well-used frameworks or whether these are experimental and/or
 obsolete systems.
 
 I find it odd that a container would make it impossible for a contained
 application to override libraries that the parent provides. This seems
 rather fragile and inflexible to me; maybe reading the documentation for
 some projects which Jake has referred to will help me understand the
 reasons for using parent-first delegation.

I received the following email from Paul Smith ([EMAIL PROTECTED]) which
did not get to this list because, apparently, the moderator rejected it.
It's certainly on-topic and useful so I presume this was just a slip of
the mouse on the moderator's part. Anyway, here's Paul's email:

mail
Resin's default class loader behaviour is parent first.  In Resin 2 to 
emulate the true specifaction, one has to:

servlet-classloader-hackfalse/servlet-classloader-hack  [1]

Which shows you what the Caucho folks think of child-first
delegation :)

[1] - http://www.caucho.com/support/resin-interest/0403/0132.html

Paul Smith
/mail

Following the email thread referred to above:

* Joseph Dane recommends using Resin's default parent-first classloading
but ensuring that the Resin classloader actually has no jars in the path
(ie nothing in resin/lib).
simonWell, if there is nothing in the parent classloader, then
parent-first and child-first are effectively equivalent, yes? So this
advice is not bad, but doesn't shed any light on why Resin goes with
parent-first/simon

* Eric Hauser recommends using a Resin-proprietory extension to
classloading, which involves putting
  classpath id='/path-to-hibernate/hibernate2.jar' /
in the web.xml file.
simonI'll try to track down exactly what exactly this does with
respect to class-loaders and CLASSPATHs/simon


NB: in Resin 3.0, the servlet-classloader-hack feature still exists,
but has been moved in the config file to class-loader/servlet-hack.


I've done a fair bit of research in the hope of finding additional info
on resin's classloading policy:

* The Resin docs for the servlet-classloader-hack config element:
http://www.caucho.com/products/resin/ref/http-config.xtp#servlet-classloader-hack
Nope, no clues there

* Hmm..here's a reply to a question from one Torsten Curdt; now where
have I seen that name lately? :-)
http://www.caucho.com/support/resin-interest/0305/0223.html
In the end, though, it doesn't shed a lot of light on why Resin doesn't
wish to follow the java spec...

The resin-reference.pdf file has a fraction more information. It
states that using child-first loading can cause surprising
ClassCaseExceptions. Yep, that's the full description of why they
reject the sun recommendation.

The resin source code doesn't hold any clues either. No comments at all
on why they prefer parent-first.


So I'm still looking for someone to suggest why anyone would not use
child-first


Regards,

Simon


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [logging] parent-first classloaders

2005-03-09 Thread Brian Stansberry
--- Simon Kitching [EMAIL PROTECTED] wrote:
 Hi Ceki,
 
 You mentioned in your page on JCL
 (http://www.qos.ch/logging/classloader.jsp):
 
 quote
 Jake also keeps reminding us on the log4j-dev
 mailing list that the
 child-parent delegation model is not the only model
 out there and that
 parent-first delegation model is alive and well.
 /quote
 
 Are you able to provide the names of some frameworks
 that use
 parent-first classloading? I'm curious to find out
 whether these are
 large + well-used frameworks or whether these are
 experimental and/or
 obsolete systems.
 
 I find it odd that a container would make it
 impossible for a contained
 application to override libraries that the parent
 provides. This seems
 rather fragile and inflexible to me; maybe reading
 the documentation for
 some projects which Jake has referred to will help
 me understand the
 reasons for using parent-first delegation.
 

JBoss also defaults to parent-first delegation (their
Tomcat integration overrides the standard TC
classloading).  To get child-first classloading you
have to add

class-loading java2ClassLoadingCompliance=false/

to your war's jboss-web.xml file.

I believe the EJB spec mandates standard Java2 (i.e.
parent-first) classloading as well.

Best regards,
Brian

 Regards,
 
 Simon
 
 

-
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 
 



__ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/ 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]