关闭

tomcat类加载器的层次及加载路径

标签: tomcat
462人阅读 评论(0) 收藏 举报
分类:

程序代码

URLClassLoader loader = (URLClassLoader) this.getClass().getClassLoader();
while (loader != null) {
    System.out.println(loader.getClass().getName());
    URL[] urls = loader.getURLs();
    for (URL url : urls)
        System.out.println(url);
    System.out.println("----------------------------");

    loader = (URLClassLoader)loader.getParent();
}

System.out.println("BootstrapClassLoader加载路径: ");
URL[] urls = sun.misc.Launcher.getBootstrapClassPath().getURLs();
for (URL url : urls) {
    System.out.println(url);
}

运行结果

org.apache.catalina.loader.WebappClassLoader
项目的加载路径…
org.apache.catalina.loader.StandardClassLoader
file:/C:/Program%20Files%20(x86)/Tomcat/apache-tomcat-7.0.62/lib/
file:/C:/Program%20Files%20(x86)/Tomcat/apache-tomcat-7.0.62/lib/annotations-api.jar
file:/C:/Program%20Files%20(x86)/Tomcat/apache-tomcat-7.0.62/lib/catalina-ant.jar
file:/C:/Program%20Files%20(x86)/Tomcat/apache-tomcat-7.0.62/lib/catalina-ha.jar
file:/C:/Program%20Files%20(x86)/Tomcat/apache-tomcat-7.0.62/lib/catalina-tribes.jar
file:/C:/Program%20Files%20(x86)/Tomcat/apache-tomcat-7.0.62/lib/catalina.jar
file:/C:/Program%20Files%20(x86)/Tomcat/apache-tomcat-7.0.62/lib/ecj-4.4.2.jar
file:/C:/Program%20Files%20(x86)/Tomcat/apache-tomcat-7.0.62/lib/el-api.jar
file:/C:/Program%20Files%20(x86)/Tomcat/apache-tomcat-7.0.62/lib/jasper-el.jar
file:/C:/Program%20Files%20(x86)/Tomcat/apache-tomcat-7.0.62/lib/jasper.jar
file:/C:/Program%20Files%20(x86)/Tomcat/apache-tomcat-7.0.62/lib/jsp-api.jar
file:/C:/Program%20Files%20(x86)/Tomcat/apache-tomcat-7.0.62/lib/servlet-api.jar
file:/C:/Program%20Files%20(x86)/Tomcat/apache-tomcat-7.0.62/lib/tomcat-api.jar
file:/C:/Program%20Files%20(x86)/Tomcat/apache-tomcat-7.0.62/lib/tomcat-coyote.jar
file:/C:/Program%20Files%20(x86)/Tomcat/apache-tomcat-7.0.62/lib/tomcat-dbcp.jar
file:/C:/Program%20Files%20(x86)/Tomcat/apache-tomcat-7.0.62/lib/tomcat-i18n-es.jar
file:/C:/Program%20Files%20(x86)/Tomcat/apache-tomcat-7.0.62/lib/tomcat-i18n-fr.jar
file:/C:/Program%20Files%20(x86)/Tomcat/apache-tomcat-7.0.62/lib/tomcat-i18n-ja.jar
file:/C:/Program%20Files%20(x86)/Tomcat/apache-tomcat-7.0.62/lib/tomcat-jdbc.jar
file:/C:/Program%20Files%20(x86)/Tomcat/apache-tomcat-7.0.62/lib/tomcat-util.jar
file:/C:/Program%20Files%20(x86)/Tomcat/apache-tomcat-7.0.62/lib/tomcat7-websocket.jar
file:/C:/Program%20Files%20(x86)/Tomcat/apache-tomcat-7.0.62/lib/websocket-api.jar
sun.misc.Launcher$AppClassLoader
file:/C:/Program%20Files%20(x86)/Tomcat/apache-tomcat-7.0.62/bin/bootstrap.jar
file:/C:/Program%20Files%20(x86)/Tomcat/apache-tomcat-7.0.62/bin/tomcat-juli.jar
sun.misc.Launcher$ExtClassLoader
file:/C:/Program%20Files%20(x86)/Java/jdk1.7.0_79/jre/lib/ext/access-bridge-32.jar
file:/C:/Program%20Files%20(x86)/Java/jdk1.7.0_79/jre/lib/ext/dnsns.jar
file:/C:/Program%20Files%20(x86)/Java/jdk1.7.0_79/jre/lib/ext/jaccess.jar
file:/C:/Program%20Files%20(x86)/Java/jdk1.7.0_79/jre/lib/ext/localedata.jar
file:/C:/Program%20Files%20(x86)/Java/jdk1.7.0_79/jre/lib/ext/sunec.jar
file:/C:/Program%20Files%20(x86)/Java/jdk1.7.0_79/jre/lib/ext/sunjce_provider.jar
file:/C:/Program%20Files%20(x86)/Java/jdk1.7.0_79/jre/lib/ext/sunmscapi.jar
file:/C:/Program%20Files%20(x86)/Java/jdk1.7.0_79/jre/lib/ext/sunpkcs11.jar
file:/C:/Program%20Files%20(x86)/Java/jdk1.7.0_79/jre/lib/ext/zipfs.jar
BootstrapClassLoader加载路径:
file:/C:/Program%20Files%20(x86)/Java/jdk1.7.0_79/jre/lib/resources.jar
file:/C:/Program%20Files%20(x86)/Java/jdk1.7.0_79/jre/lib/rt.jar
file:/C:/Program%20Files%20(x86)/Java/jdk1.7.0_79/jre/lib/sunrsasign.jar
file:/C:/Program%20Files%20(x86)/Java/jdk1.7.0_79/jre/lib/jsse.jar
file:/C:/Program%20Files%20(x86)/Java/jdk1.7.0_79/jre/lib/jce.jar
file:/C:/Program%20Files%20(x86)/Java/jdk1.7.0_79/jre/lib/charsets.jar
file:/C:/Program%20Files%20(x86)/Java/jdk1.7.0_79/jre/lib/jfr.jar
file:/C:/Program%20Files%20(x86)/Java/jdk1.7.0_79/jre/classes

0
0

猜你在找
【直播】机器学习&数据挖掘7周实训--韦玮
【套餐】系统集成项目管理工程师顺利通关--徐朋
【直播】3小时掌握Docker最佳实战-徐西宁
【套餐】机器学习系列套餐(算法+实战)--唐宇迪
【直播】计算机视觉原理及实战--屈教授
【套餐】微信订阅号+服务号Java版 v2.0--翟东平
【直播】机器学习之矩阵--黄博士
【套餐】微信订阅号+服务号Java版 v2.0--翟东平
【直播】机器学习之凸优化--马博士
【套餐】Javascript 设计模式实战--曾亮
查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:1197次
    • 积分:118
    • 等级:
    • 排名:千里之外
    • 原创:8篇
    • 转载:1篇
    • 译文:0篇
    • 评论:0条
    文章存档