是由于见识的比较少
不知道weblogic jar包使用的是zip协议
偶然发现日志中都是URL [zip:E:/weblogic/user_projects/domains/base_domain/lib/com.xxx.jar!/
,
利用之前的见识 偶然一猜,果然是之前扫描的时候的问题,之前只扫描了file和jar包,对于zip类型的没有处理
,果然加上一个if条件 就可以了。。。。
if(URL_PROTOCOL_JAR.equals(protocol)||URL_PROTOCOL_ZIP.equals(protocol))
附上代码
if (URL_PROTOCOL_JAR.equals(protocol) || URL_PROTOCOL_ZIP.equals(protocol)) {
String packageDirName = packageName.replace('.', '/');
JarFile jarFile = new JarFile(new File(url.getFile().replace("!/" + packageDirName, "")));
Enumeration<JarEntry> jarEntryEnumeration = jarFile.entries();
while (jarEntryEnumeration.hasMoreElements()) {
JarEntry jarEntry = jarEntryEnumeration.nextElement();
String jarEntryName = jarEntry.getName();
if (jarEntryName.endsWith(CLASS_FILE_NAME_ENDED)) {
String className = jarEntryName.substring(0, jarEntryName.lastIndexOf(".")).replaceAll("/", ".");
doAddClass(classSet, className);
}
}
}