博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
使用这个工具来检查classLoader的问题
阅读量:7048 次
发布时间:2019-06-28

本文共 7755 字,大约阅读时间需要 25 分钟。

  hot3.png

将以下代码保存为path.jsp,放于server的文件目录下:

<%@page pageEncoding="UTF-8"%><%@page import="java.net.URL" %><%@page import="java.io.*" %><%!String getClassPath(String className){	StringBuffer sb=new StringBuffer("className:"+className+"
"); try { Class z=Class.forName(className); String path = z.getName().replace(".", "/"); path ="/"+path+".class"; URL url=z.getResource(path); if(url!=null){ sb.append("class loader:"+z.getClassLoader()); sb.append("
class path:"+url.getPath()); }else{ sb.append("class not loaded by any classLoader"); } } catch (Exception e) { e.printStackTrace(); StringWriter writer = new StringWriter(); PrintWriter pw = new PrintWriter(writer); e.printStackTrace(pw); pw.close(); sb.append("error:"+e); sb.append("
"+writer.toString()+"
"); } return sb.toString(); }%>find class path
class full name:

<%String className=request.getParameter("className");if(className!=null && !"".equals(className)){ out.println(getClassPath(className));}%>
然后访问此文件路径,得到页面,输入完整的classname, 可以得到如下信息:
className:com.ibatis.dao.client.DaoManagerclass loader: com.ibm.ws.classloader.CompoundClassLoader@22ed7bd4[war:Forums/forum.web.war] Local ClassPath: C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\WIN-H05L8ME1F0NCell01\Forums.ear\forum.web.war\WEB-INF\classes;C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\WIN-H05L8ME1F0NCell01\Forums.ear\forum.web.war\WEB-INF\lib\AjaxProxy.jar;C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\WIN-H05L8ME1F0NCell01\Forums.ear\forum.web.war\WEB-INF\lib\castor-1.0.5-xml.jar;C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\WIN-H05L8ME1F0NCell01\Forums.ear\forum.web.war\WEB-INF\lib\commons-fileupload-1.2.1.jar;C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\WIN-H05L8ME1F0NCell01\Forums.ear\forum.web.war\WEB-INF\lib\forum.api.jar;C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\WIN-H05L8ME1F0NCell01\Forums.ear\forum.web.war\WEB-INF\lib\forum.svc.jar;C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\WIN-H05L8ME1F0NCell01\Forums.ear\forum.web.war\WEB-INF\lib\forum.web.jar;C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\WIN-H05L8ME1F0NCell01\Forums.ear\forum.web.war\WEB-INF\lib\ibatis-dao-2.jar;C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\WIN-H05L8ME1F0NCell01\Forums.ear\forum.web.war\WEB-INF\lib\jtidy-r938.jar;C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\WIN-H05L8ME1F0NCell01\Forums.ear\forum.web.war\WEB-INF\lib\lc.extdatamodel.impl.jar;C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\WIN-H05L8ME1F0NCell01\Forums.ear\forum.web.war\WEB-INF\lib\lc.oauth.messages.jar;C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\WIN-H05L8ME1F0NCell01\Forums.ear\forum.web.war\WEB-INF\lib\lc.oauth.platform.jar;C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\WIN-H05L8ME1F0NCell01\Forums.ear\forum.web.war\WEB-INF\lib\lc.oauth.platform.mbeans.jar;C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\WIN-H05L8ME1F0NCell01\Forums.ear\forum.web.war\WEB-INF\lib\lc.oauth.provider.web.jar;C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\WIN-H05L8ME1F0NCell01\Forums.ear\forum.web.war\WEB-INF\lib\lc.proxy2.5.jar;C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\WIN-H05L8ME1F0NCell01\Forums.ear\forum.web.war\WEB-INF\lib\lc.search.externalAPI.connections.jar;C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\WIN-H05L8ME1F0NCell01\Forums.ear\forum.web.war\WEB-INF\lib\lc.search.seedlist.framework.jar;C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\WIN-H05L8ME1F0NCell01\Forums.ear\forum.web.war\WEB-INF\lib\lc.search.seedlist.retriever.forums.jar;C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\WIN-H05L8ME1F0NCell01\Forums.ear\forum.web.war\WEB-INF\lib\lc.util.share.jar;C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\WIN-H05L8ME1F0NCell01\Forums.ear\forum.web.war\WEB-INF\lib\lc.util.web-3.0.jar;C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\WIN-H05L8ME1F0NCell01\Forums.ear\forum.web.war\WEB-INF\lib\lc.widgets.core.jar;C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\WIN-H05L8ME1F0NCell01\Forums.ear\forum.web.war\WEB-INF\lib\lucene-core-1.9.1.jar;C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\WIN-H05L8ME1F0NCell01\Forums.ear\forum.web.war\WEB-INF\lib\mybatis-2.3.5.jar;C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\WIN-H05L8ME1F0NCell01\Forums.ear\forum.web.war\WEB-INF\lib\ognl-2.6.9.jar;C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\WIN-H05L8ME1F0NCell01\Forums.ear\forum.web.war\WEB-INF\lib\search.searchInterface.jar;C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\WIN-H05L8ME1F0NCell01\Forums.ear\forum.web.war\WEB-INF\lib\sn.av.admin.jar;C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\WIN-H05L8ME1F0NCell01\Forums.ear\forum.web.war\WEB-INF\lib\sn.av.api.jar;C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\WIN-H05L8ME1F0NCell01\Forums.ear\forum.web.war\WEB-INF\lib\sn.av.icap.jar;C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\WIN-H05L8ME1F0NCell01\Forums.ear\forum.web.war\WEB-INF\lib\spring.jar;C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\WIN-H05L8ME1F0NCell01\Forums.ear\forum.web.war\WEB-INF\lib\struts.jar;C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\WIN-H05L8ME1F0NCell01\Forums.ear\forum.web.war\WEB-INF\lib\struts2-core-2.0.14-noStaticNoFreemarker.jar;C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\WIN-H05L8ME1F0NCell01\Forums.ear\forum.web.war\WEB-INF\lib\struts2-tiles-plugin-2.0.14.jar;C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\WIN-H05L8ME1F0NCell01\Forums.ear\forum.web.war\WEB-INF\lib\tiles-api-2.0.4.jar;C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\WIN-H05L8ME1F0NCell01\Forums.ear\forum.web.war\WEB-INF\lib\tiles-core-2.0.4-minus-rbh.jar;C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\WIN-H05L8ME1F0NCell01\Forums.ear\forum.web.war\WEB-INF\lib\tiles-jsp-2.0.4.jar;C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\WIN-H05L8ME1F0NCell01\Forums.ear\forum.web.war\WEB-INF\lib\tk.rproxysvc.client.jar;C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\WIN-H05L8ME1F0NCell01\Forums.ear\forum.web.war\WEB-INF\lib\xwork-2.0.4.jar;C:\Program Files (x86)\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\WIN-H05L8ME1F0NCell01\Forums.ear\forum.web.war Parent: com.ibm.ws.classloader.CompoundClassLoader@22ed7a78[PL][app:Forums] Delegation Mode: PARENT_FIRSTclass path:file:/C:/Program%20Files%20(x86)/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/WIN-H05L8ME1F0NCell01/Forums.ear/forum.web.war/WEB-INF/lib/ibatis-dao-2.jar!/com/ibatis/dao/client/DaoManager.class

转载于:https://my.oschina.net/xpbug/blog/84603

你可能感兴趣的文章
项目打包流程
查看>>
vue-cli项目动态引用图片链接问题
查看>>
规格模式取代sql查询代码
查看>>
iOS 如何去掉Tabbar上的黑线
查看>>
eclipse远程调试(windows)
查看>>
FDStatusBarNotifierView
查看>>
OpenStack云平台的网络模式及其工作机制
查看>>
PHP-FIG 定义的 PSR-3 日志接口规范
查看>>
【Qt笔记】使用拖放
查看>>
接口测试常用工具
查看>>
MyISAM和InnoDB的索引实现
查看>>
这样的一个asp.net免费购物系统的发展空间
查看>>
2018年最值得关注的30个Vue开源项目
查看>>
Java程序员,最常用的20%技术有哪些
查看>>
php+mysql 判断记录位置
查看>>
方法与函数的区别
查看>>
HLS-AES 128 格式视频服务,flash 通过 https 获取加密密钥失败原因以及解决方法
查看>>
linux常用软件安装命令
查看>>
wordpress功能集成(三):基础知识-wordpress过滤器
查看>>
mysql 笔记
查看>>