tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cox, Charlie" <c...@cincom.com>
Subject RE: Debugging class loading
Date Tue, 10 Sep 2002 17:20:06 GMT


> -----Original Message-----
> From: Michael Petres [mailto:mpetres@rogers.com]
> Sent: Tuesday, September 10, 2002 12:50 PM
> To: Tomcat Users List
> Subject: RE: Debugging class loading
> 
> 
> On the first count... how doe I configure the context to load 
> my own webapp
> class loader? Is there some place I can see an example?
> 
The <Loader> tag goes within the <Context> tag, not under it as you stated
below. You should be able to use the Loader line below with that change. I
have not tried this so I can't really offer much more that what's in the
docs. 

> Re class loading hierarchy: It is my understanding that 
> starting with the
> System class loader, Tomcat ignores the class path and 
> supplies its own
> implementations of the class loaders. 

True.

>Is it not possible to 
> specify custom
> class loaders for (and/or) System, Common, Catalina, Shared loaders?

Not to my knowledge. You can browse through the source code and look for
something that calls StandardClassLoader to see if there is a way, but as I
recall from browsing the source is that it is hardcoded in there. 

you probably wouldn't want the StandardClassLoader to be configurable
through server.xml for security reasons. 

you would probably have to build your own tomcat to do this.

Charlie

> 
> Michael Petres
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> InnovObjX Corp.
> Web: www.innovobjx.com
> Tel: 905-729-2235 x3
> Fax: 905-729-2235
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> -----Original Message-----
> From: Cox, Charlie [mailto:ccox@cincom.com]
> Sent: Tuesday, September 10, 2002 9:37 AM
> To: 'Tomcat Users List'
> Subject: RE: Debugging class loading
> 
> What I was getting at is that the WebApp Classloader(or your 
> custom cl) does
> not load all the classes used by tomcat. Therefore, you will 
> only be able to
> create your dump for the classes loaded within your webapp, not from
> /common/lib or /tomcat/lib or any of Tomcat's interal 
> classes. You will see
> that a class is requested, but once you delegate to your 
> parent, you have no
> idea which parent loads the class AFAIK.
> 
> Also, each webapp gets its own classloader instance.
> 
> If this does not accomplish your goals, you have the source :)
> 
> You can also open an enhancement request through bugzilla.
> 
> Charlie
> 
> > -----Original Message-----
> > From: Michael Petres [mailto:mpetres@rogers.com]
> > Sent: Monday, September 10, 2001 9:07 AM
> > To: Tomcat Users List
> > Subject: RE: Debugging class loading
> >
> >
> > We have a shrink-wrapped product. Many of our support calls
> > have to deal
> > with classloader issues, to be more specific, as our
> > application is deployed
> > in different environments, the support engineers are spending
> > lots of time
> > ensuring that the right classes are loaded from the right places...
> >
> > We were thinking of being able to generate a class load dump
> > (through our
> > custom class loader) to facilitate the trouble shooting 
> procedure....
> > Perhaps this should be a feature of tomcat. Until then we
> > need to use our
> > own class loader, nothing fancy...
> >
> > Michael Petres
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > InnovObjX Corp.
> > Web: www.innovobjx.com
> > Tel: 905-729-2235 x3
> > Fax: 905-729-2235
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >
> > -----Original Message-----
> > From: Cox, Charlie [mailto:ccox@cincom.com]
> > Sent: Tuesday, September 10, 2002 7:49 AM
> > To: 'Tomcat Users List'
> > Subject: RE: Debugging class loading
> >
> > before you go hacking with your own classloader, have you 
> reviewed the
> > classloader doc? What kind of problems are you having?
> >
> > Only classes in each web application are loaded by the web app's
> > classloader. If you have classes in \common\lib or
> > \tomcat\lib, they are
> > loaded by StandardClassLoader.
> >
> > Charlie
> >
> > > -----Original Message-----
> > > From: Michael Petres [mailto:michaelp@innovobjx.com]
> > > Sent: Sunday, September 08, 2002 9:32 PM
> > > To: tomcat-user@jakarta.apache.org
> > > Subject: Debugging class loading
> > >
> > >
> > > Folks,
> > >
> > > I have run into some problems with class loading in my
> > > servlet... I would like
> > > to debug the loading of ALL classes by tomcat. One option I
> > > was thinking of
> > > was to (for debugging) add a the following under the 
> <context> tag :
> > >
> > >
> > > <Loader className="org.apache.catalina.loader.WebappLoader"
> > > delegate="false"
> > > reloadable="false" checkInterval="15" debug="99"
> > >
> > > cloaderClass="my.custom.CustomClassLoader"/>
> > >
> > > where CustomClassLoader would extend WebappClassLoader. Is
> > > this feasible ?
> > > Perhaps there is a better option....
> > >
> > > I would appreciate any ideas as I am stuck with this problem...
> > >
> > > Thanx,
> > > Michael Petres
> > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > InnovObjX Corp.
> > > Web: www.innovobjx.com
> > > Tel: 905-729-2235 x3
> > > Fax: 905-729-2235
> > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > >
> > >
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> > <mailto:tomcat-user-help@jakarta.apache.org>
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> > <mailto:tomcat-user-help@jakarta.apache.org>
> >
> 
> --
> To unsubscribe, e-mail:
> <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:tomcat-user-help@jakarta.apache.org>
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: 
> <mailto:tomcat-user-help@jakarta.apache.org>
> 

--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message