Author: markt Date: Wed Nov 8 20:14:37 2006 New Revision: 472767 URL: http://svn.apache.org/viewvc?view=rev&rev=472767 Log: Fix bug 37588. Fix creation of JNDI Realm through the admin webapp.
Modified: tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/mbeans/MBeanFactory.java tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/mbeans/mbeans-descriptors.xml tomcat/container/tc5.5.x/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/realm/SaveJNDIRealmAction.java tomcat/container/tc5.5.x/webapps/docs/changelog.xml Modified: tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/mbeans/MBeanFactory.java URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/mbeans/MBeanFactory.java?view=diff&rev=472767&r1=472766&r2=472767 ============================================================================== --- tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/mbeans/MBeanFactory.java (original) +++ tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/mbeans/MBeanFactory.java Wed Nov 8 20:14:37 2006 @@ -309,8 +309,8 @@ * @exception Exception if an MBean cannot be created or registered */ public String createHttpConnector(String parent, String address, int port) - throws Exception { - return createConnector(parent, address, port, false, false); + throws Exception { + return createConnector(parent, address, port, false, false); } /** @@ -372,7 +372,8 @@ * @exception Exception if an MBean cannot be created or registered */ public String createJDBCRealm(String parent, String driverName, - String connectionName, String connectionPassword, String connectionURL) + String connectionName, String connectionPassword, + String connectionURL) throws Exception { // Create a new JDBCRealm instance @@ -403,17 +404,21 @@ * Create a new JNDI Realm. * * @param parent MBean Name of the associated parent component + * @param connectionURL URL to connect to directory + * @param connectionName Username to use to establish connection + * @param connectionPassword Password to authenticate with * * @exception Exception if an MBean cannot be created or registered */ - public String createJNDIRealm(String parent,String connectionURL,String connectionName,String connectionPassword) + public String createJNDIRealm(String parent, String connectionURL, + String connectionName,String connectionPassword) throws Exception { // Create a new JNDIRealm instance JNDIRealm realm = new JNDIRealm(); - realm.setConnectionURL(connectionURL); - realm.setConnectionName(connectionName); - realm.setConnectionPassword(connectionPassword); + realm.setConnectionURL(connectionURL); + realm.setConnectionName(connectionName); + realm.setConnectionPassword(connectionPassword); // Add the new instance to its parent component ObjectName pname = new ObjectName(parent); ContainerBase containerBase = getParentContainerFromParent(pname); @@ -430,7 +435,7 @@ } - + /** * Create a new JAAS Realm. * @@ -443,15 +448,15 @@ // Create a new JAASRealm instance JAASRealm realm = new JAASRealm(); - realm.setAppName(appName); - realm.setUserClassNames(userClassNames); - realm.setRoleClassNames(roleClassNames); - if("true".equals(useContextClassLoader)||"TRUE".equals(useContextClassLoader)){ - realm.setUseContextClassLoader(true); - } - else{ - realm.setUseContextClassLoader(false); - } + realm.setAppName(appName); + realm.setUserClassNames(userClassNames); + realm.setRoleClassNames(roleClassNames); + if("true".equals(useContextClassLoader) || + "TRUE".equals(useContextClassLoader)){ + realm.setUseContextClassLoader(true); + } else { + realm.setUseContextClassLoader(false); + } // Add the new instance to its parent component ObjectName pname = new ObjectName(parent); ContainerBase containerBase = getParentContainerFromParent(pname); @@ -767,7 +772,7 @@ host.setUnpackWARs(unpackWARs); host.setXmlNamespaceAware(xmlNamespaceAware); host.setXmlValidation(xmlValidation); - + // add HostConfig for active reloading HostConfig hostConfig = new HostConfig(); host.addLifecycleListener(hostConfig); @@ -1114,4 +1119,5 @@ } } + Modified: tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/mbeans/mbeans-descriptors.xml URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/mbeans/mbeans-descriptors.xml?view=diff&rev=472767&r1=472766&r2=472767 ============================================================================== --- tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/mbeans/mbeans-descriptors.xml (original) +++ tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/mbeans/mbeans-descriptors.xml Wed Nov 8 20:14:37 2006 @@ -119,36 +119,37 @@ returnType="java.lang.String"> <parameter name="parent" description="MBean Name of the associated parent component" - type="java.lang.String"/> - <parameter name="connectionURL" + type="java.lang.String"/> + <parameter name="connectionURL" description="Jndi Connection URL" - type="java.lang.String"/> - <parameter name="connectionName" + type="java.lang.String"/> + <parameter name="connectionName" description="Connection name" - type="java.lang.String"/> - <parameter name="connectionPassword" + type="java.lang.String"/> + <parameter name="connectionPassword" description="Connection password" - type="java.lang.String"/> + type="java.lang.String"/> </operation> + <operation name="createJAASRealm" description="Create a new Jaas Realm" impact="ACTION" returnType="java.lang.String"> <parameter name="parent" description="MBean Name of the associated parent component" - type="java.lang.String"/> - <parameter name="appName" + type="java.lang.String"/> + <parameter name="appName" description="App name" - type="java.lang.String"/> - <parameter name="userClassNames" + type="java.lang.String"/> + <parameter name="userClassNames" description="Users class names." - type="java.lang.String"/> - <parameter name="roleClassNames" + type="java.lang.String"/> + <parameter name="roleClassNames" description="Role classNames" - type="java.lang.String"/> - <parameter name="useContextClassLoader" + type="java.lang.String"/> + <parameter name="useContextClassLoader" description="Whether use context classloader" - type="java.lang.String"/> + type="java.lang.String"/> </operation> <operation name="createMemoryRealm" Modified: tomcat/container/tc5.5.x/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/realm/SaveJNDIRealmAction.java URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/realm/SaveJNDIRealmAction.java?view=diff&rev=472767&r1=472766&r2=472767 ============================================================================== --- tomcat/container/tc5.5.x/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/realm/SaveJNDIRealmAction.java (original) +++ tomcat/container/tc5.5.x/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/realm/SaveJNDIRealmAction.java Wed Nov 8 20:14:37 2006 @@ -19,17 +19,11 @@ import java.net.URLEncoder; -import java.util.Iterator; import java.util.Locale; import java.io.IOException; import javax.management.Attribute; import javax.management.MBeanServer; -import javax.management.MBeanServerFactory; -import javax.management.QueryExp; -import javax.management.Query; -import javax.management.ObjectInstance; import javax.management.ObjectName; -import javax.management.JMException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -66,9 +60,9 @@ */ private String createStandardRealmTypes[] = { "java.lang.String", // parent - "java.lang.String", //Connection URL - "java.lang.String", //Connection name - "java.lang.String", //Connection password + "java.lang.String", // connection URL + "java.lang.String", // connection name + "java.lang.String", // connection password }; Modified: tomcat/container/tc5.5.x/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/webapps/docs/changelog.xml?view=diff&rev=472767&r1=472766&r2=472767 ============================================================================== --- tomcat/container/tc5.5.x/webapps/docs/changelog.xml (original) +++ tomcat/container/tc5.5.x/webapps/docs/changelog.xml Wed Nov 8 20:14:37 2006 @@ -34,28 +34,6 @@ (markt) </fix> <fix> - <bug>37439</bug>: Update documentation for Engine component to add - the requirement that the name must be unique. (markt) - </fix> - <fix> - <bug>37458</bug>: Add syncs to the WebappClassloader to address - rare issues when multiple threads attempt to load the same class - concurrently. (markt) - </fix> - <fix> - <bug>38198</bug>: Add reference to Context documentation from Host - documentation that explains how Context name is obtained from the - Context filename. (markt) - </fix> - <fix> - <bug>39436</bug>: Correct MIME type for SVG. (markt) - </fix> - <fix> - <bug>39724</bug>: Removing the last valve from a pipeline did not - return the pipeline to the original state. Patch provided by - David Gagon. (markt) - </fix> - <fix> <bug>36976</bug>: Don't use CATALINA_OPTS when stopping Tomcat. This allows options for starting and stopping to be set on JAVA_OPTS and options for starting only to be set on CATALINA_OPTS. Without this @@ -63,10 +41,6 @@ stop to fail. Based on a fix suggested by Michael Vorburger. (markt) </fix> <fix> - <bug>37509</bug>: Do not remove whitespace from the end of values - defined in logging.properties files. (markt) - </fix> - <fix> <bug>37070</bug>: Update mbean name documentation to include the StandardWrapper. (markt) </fix> @@ -82,6 +56,32 @@ (markt) </fix> <fix> + <bug>37439</bug>: Update documentation for Engine component to add + the requirement that the name must be unique. (markt) + </fix> + <fix> + <bug>37458</bug>: Add syncs to the WebappClassloader to address + rare issues when multiple threads attempt to load the same class + concurrently. (markt) + </fix> + <fix> + <bug>37509</bug>: Do not remove whitespace from the end of values + defined in logging.properties files. (markt) + </fix> + <fix> + <bug>38198</bug>: Add reference to Context documentation from Host + documentation that explains how Context name is obtained from the + Context filename. (markt) + </fix> + <fix> + <bug>39436</bug>: Correct MIME type for SVG. (markt) + </fix> + <fix> + <bug>39724</bug>: Removing the last valve from a pipeline did not + return the pipeline to the original state. Patch provided by + David Gagon. (markt) + </fix> + <fix> <bug>40528</bug>: Add missing message localisations as provided by Ben Clifford. (markt) </fix> @@ -131,6 +131,10 @@ <fix> <bug>35968</bug>: Make environment entry properties input a text area. Patch provided by Tristan Marly. (markt) + </fix> + <fix> + <bug>37588</bug>: Fix creation of JNDI Realm in admin application. Patch + provided by Terry Zhou. (markt) </fix> <fix> <bug>38048</bug>: Fix memory leak assoaciated with use of expression --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]