On 25/09/2012 13:19, Elgs Chen wrote:
> Dear Tomcat Developers,
> 
> I have a question regarding the behavior of the 
> WebClassLoader.loadClass(String name, boolean resolve) in the 
> org.apache.catalina.loader package.
> 
> I have the following assumptions, please correct me if any is wrong:
> 1, It seems the WebClassLoader only uses the SystemClassLoader (or 
> AppClassLoader) to loader tomcat core classes, like ServletDef;

Wrong. See [1].

> 2, It seems if tomcat is started up by the startup.sh from the bin directory, 
> the classpath in the startup command line will include only the jars in the 
> bin directory: bootstrap.jar, commons-daemon.jar and tomcat-juli.jar;

Correct.

> 3, ClassLoader.getSystemClassLoader() by default returns the class loader 
> with the startup command-line classpath; 

Correct.

> Now if the above three assumption are correct, it seems that it's not 
> possible for the WebClassLoader to load the tomcat core classes as only the 
> few bootstrap jars are in the system class loader's classpath. However, the 
> fact is the startup.sh script indeed starts tomcat up. Why?

The logical conclusion would be that one or more of the assumptions is
wrong.


> So my question is:
> How does the startup.sh shipped with tomcat binary make the WebClassLoader to 
> load the ServletDef?

See [2], line 262.

Mark


[1] http://tomcat.apache.org/tomcat-7.0-doc/class-loader-howto.html
[2]
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/Bootstrap.java?view=annotate

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to