You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Craig R <to...@frontloader.net> on 2003/02/28 21:21:59 UTC
Classes are not loaded from WEB-INF/classes when debugging...
Hello,
I am running into a problem with classloading as I try to run 2 web-
application through a debugger. The two projects have overlapping
copies of the same class files (ie, both projects use Class A).
The problem is that when Tomcat (4.0.6) is run through my debugger,
the WEB-INF/classes are not loaded by org.apache.catalina.loader.
WebappClassLoader. They are apparently loaded by the system classloader.
So my Class A instance is shared between my 2 web-apps when in
fact they should each have their own instance. Run outside the debugger,
the WebappClassloader does its job & both web-apps get their unique
copies of class A. Here is what Class A has to say about who's loading
it:
Outside the debugger:
---------------------
Class A's ClassLoader's class is [class org.apache.catalina.loader.
WebappClassLoader]
ClassLoader's parent class is [class org.apache.catalina.loader.StandardClassLoader]
ClassLoader's parent class is [class org.apache.catalina.loader.StandardClassLoader]
ClassLoader's parent class is [class sun.misc.Launcher$AppClassLoader]
ClassLoader's parent class is [class sun.misc.Launcher$ExtClassLoader]
Inside the debugger:
--------------------
SettingsMgr@73a7ab ClassLoader's class is [class sun.misc.Launcher$AppClassLoader]
ClassLoader's parent class is [class sun.misc.Launcher$ExtClassLoader]
Is there a way that I can prevent the WEB-INF classes from being
loaded by the System classloader? I know this was part of the servlet
spec as the Tomcat documentation notes:
"The web application class loader diverges from the default Java
2 delegation model (in accordance with the recommendations in the
Servlet Specification, version 2.3, section 9.6). When a request
to load a class from the web application's WebappX class loader is
processed, this class loader will look in the local repositories
first, instead of delegating before looking."
So why isn't WebbappClassLoader loading the WEB-INF/classes when
debugging? Thanks in advance for your help!
Craig
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org