made port retrieval more flexible with regards to tomcat connector object name
This commit is contained in:
@@ -208,7 +208,7 @@ public class SpringBootApp {
|
||||
Set<ObjectName> queryNames = connection.queryNames(null, null);
|
||||
|
||||
for (ObjectName objectName : queryNames) {
|
||||
if (objectName.toString().startsWith("Tomcat:type=Connector")) {
|
||||
if (objectName.toString().startsWith("Tomcat") && objectName.toString().contains("type=Connector")) {
|
||||
Object result = connection.getAttribute(objectName, "localPort");
|
||||
if (result != null) {
|
||||
return result.toString();
|
||||
|
||||
Reference in New Issue
Block a user