From: markt Date: Thu, 1 Jul 2010 18:06:47 +0000 (+0000) Subject: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=49522 X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=a9be457305dd7ea2a3f6911342496a1fd85c3298;p=tomcat7.0 Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=49522 Just use host and path in NamingResources MBean name rather than full Context MBean name git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@959736 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/core/StandardContext.java b/java/org/apache/catalina/core/StandardContext.java index 0e0ec5eca..ba8779d7e 100644 --- a/java/org/apache/catalina/core/StandardContext.java +++ b/java/org/apache/catalina/core/StandardContext.java @@ -1755,7 +1755,7 @@ public class StandardContext extends ContainerBase unregister(onameNamingResoucres); onameNamingResoucres = register(namingResources, - "type=NamingResources," + getObjectNameKeyProperties()); + "type=NamingResources," + getObjectKeyPropertiesNameOnly()); } @@ -5546,30 +5546,34 @@ public class StandardContext extends ContainerBase protected String getObjectNameKeyProperties() { StringBuilder keyProperties = - new StringBuilder("j2eeType=WebModule,name="); - - String hostName = getParent().getName(); - if (hostName == null) { - keyProperties.append("DEFAULT"); + new StringBuilder("j2eeType=WebModule,"); + keyProperties.append(getObjectKeyPropertiesNameOnly()); + keyProperties.append(",J2EEApplication="); + keyProperties.append(getJ2EEApplication()); + keyProperties.append(",J2EEServer="); + keyProperties.append(getJ2EEServer()); + + return keyProperties.toString(); + } + + private String getObjectKeyPropertiesNameOnly() { + StringBuilder result = new StringBuilder("name="); + String hostname = getParent().getName(); + if (hostname == null) { + result.append("DEFAULT"); } else { - keyProperties.append(hostName); + result.append(hostname); } String pathName = getName(); if ("".equals(pathName)) { - keyProperties.append('/'); + result.append('/'); } else { - keyProperties.append(pathName); + result.append(pathName); } - keyProperties.append(",J2EEApplication="); - keyProperties.append(getJ2EEApplication()); - keyProperties.append(",J2EEServer="); - keyProperties.append(getJ2EEServer()); - - return keyProperties.toString(); + return result.toString(); } - @Override protected void initInternal() throws LifecycleException { diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 5b6f2b58b..d79b9c902 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -149,6 +149,11 @@ 49518: Fix typo in extras documentation. (markt) + + 49522: Fix regression due to change of name for MBeans for + naming resources that broke the complete server status page in the + manager application. Note these MBeans now have a new name. (markt) +