Author: markt Date: Thu Jul 1 18:06:47 2010 New Revision: 959736 URL: http://svn.apache.org/viewvc?rev=959736&view=rev Log: 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
Modified: tomcat/trunk/java/org/apache/catalina/core/StandardContext.java tomcat/trunk/webapps/docs/changelog.xml Modified: tomcat/trunk/java/org/apache/catalina/core/StandardContext.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardContext.java?rev=959736&r1=959735&r2=959736&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/core/StandardContext.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/StandardContext.java Thu Jul 1 18:06:47 2010 @@ -1755,7 +1755,7 @@ public class StandardContext extends Con unregister(onameNamingResoucres); onameNamingResoucres = register(namingResources, - "type=NamingResources," + getObjectNameKeyProperties()); + "type=NamingResources," + getObjectKeyPropertiesNameOnly()); } @@ -5546,30 +5546,34 @@ public class StandardContext extends Con 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 { Modified: tomcat/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=959736&r1=959735&r2=959736&view=diff ============================================================================== --- tomcat/trunk/webapps/docs/changelog.xml (original) +++ tomcat/trunk/webapps/docs/changelog.xml Thu Jul 1 18:06:47 2010 @@ -149,6 +149,11 @@ <fix> <bug>49518</bug>: Fix typo in extras documentation. (markt) </fix> + <fix> + <bug>49522</bug>: 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) + </fix> </changelog> </subsection> </section> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org