This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/8.5.x by this push: new 1b9e8fd Remove the JmxRemoteLifecycleListener 1b9e8fd is described below commit 1b9e8fd1f43ed08d6b87cad5182713e1830e499e Author: Mark Thomas <ma...@apache.org> AuthorDate: Tue Jan 11 11:40:18 2022 +0000 Remove the JmxRemoteLifecycleListener --- .../mbeans/JmxRemoteLifecycleListener.java | 551 --------------------- .../apache/catalina/mbeans/LocalStrings.properties | 8 - .../catalina/mbeans/LocalStrings_es.properties | 16 - .../catalina/mbeans/LocalStrings_fr.properties | 7 - .../catalina/mbeans/LocalStrings_ja.properties | 7 - .../catalina/mbeans/LocalStrings_ko.properties | 7 - .../catalina/mbeans/LocalStrings_zh_CN.properties | 4 - res/spotbugs/filter-false-positives.xml | 6 - webapps/docs/changelog.xml | 3 + webapps/docs/config/listeners.xml | 107 ---- 10 files changed, 3 insertions(+), 713 deletions(-) diff --git a/java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java b/java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java deleted file mode 100644 index bdc3a89..0000000 --- a/java/org/apache/catalina/mbeans/JmxRemoteLifecycleListener.java +++ /dev/null @@ -1,551 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.catalina.mbeans; - -import java.io.IOException; -import java.io.Serializable; -import java.lang.management.ManagementFactory; -import java.net.InetAddress; -import java.net.MalformedURLException; -import java.net.ServerSocket; -import java.net.Socket; -import java.net.UnknownHostException; -import java.rmi.AccessException; -import java.rmi.AlreadyBoundException; -import java.rmi.NotBoundException; -import java.rmi.Remote; -import java.rmi.RemoteException; -import java.rmi.server.RMIClientSocketFactory; -import java.rmi.server.RMIServerSocketFactory; -import java.security.NoSuchAlgorithmException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Locale; - -import javax.management.remote.JMXConnectorServer; -import javax.management.remote.JMXServiceURL; -import javax.management.remote.rmi.RMIConnectorServer; -import javax.management.remote.rmi.RMIJRMPServerImpl; -import javax.net.ssl.SSLContext; -import javax.net.ssl.SSLServerSocket; -import javax.net.ssl.SSLServerSocketFactory; -import javax.rmi.ssl.SslRMIClientSocketFactory; -import javax.rmi.ssl.SslRMIServerSocketFactory; - -import org.apache.catalina.Lifecycle; -import org.apache.catalina.LifecycleEvent; -import org.apache.catalina.LifecycleListener; -import org.apache.juli.logging.Log; -import org.apache.juli.logging.LogFactory; -import org.apache.tomcat.util.res.StringManager; - -/** - * This listener fixes the port used by JMX/RMI Server making things much - * simpler if you need to connect jconsole or similar to a remote Tomcat - * instance that is running behind a firewall. Only the ports are configured via - * the listener. The remainder of the configuration is via the standard system - * properties for configuring JMX. - * - * @deprecated The features provided by this listener are now available in the - * remote JMX capability included with the JRE. - * This listener will be removed in Tomcat 10 and may be removed - * from Tomcat 8.5.x some time after 2020-12-31. - */ -@Deprecated -public class JmxRemoteLifecycleListener implements LifecycleListener { - - private static final Log log = LogFactory.getLog(JmxRemoteLifecycleListener.class); - - protected static final StringManager sm = - StringManager.getManager(JmxRemoteLifecycleListener.class); - - protected String rmiBindAddress = null; - protected int rmiRegistryPortPlatform = -1; - protected int rmiServerPortPlatform = -1; - protected boolean rmiRegistrySSL = true; - protected boolean rmiServerSSL = true; - protected String ciphers[] = null; - protected String protocols[] = null; - protected boolean clientAuth = true; - protected boolean authenticate = true; - protected String passwordFile = null; - protected String loginModuleName = null; - protected String accessFile = null; - protected boolean useLocalPorts = false; - - protected JMXConnectorServer csPlatform = null; - - /** - * Get the inet address on which the Platform RMI server is exported. - * @return The textual representation of inet address - */ - public String getRmiBindAddress() { - return rmiBindAddress; - } - - /** - * Set the inet address on which the Platform RMI server is exported. - * @param theRmiBindAddress The textual representation of inet address - */ - public void setRmiBindAddress(String theRmiBindAddress) { - rmiBindAddress = theRmiBindAddress; - } - - /** - * Get the port on which the Platform RMI server is exported. This is the - * port that is normally chosen by the RMI stack. - * @return The port number - */ - public int getRmiServerPortPlatform() { - return rmiServerPortPlatform; - } - - /** - * Set the port on which the Platform RMI server is exported. This is the - * port that is normally chosen by the RMI stack. - * @param theRmiServerPortPlatform The port number - */ - public void setRmiServerPortPlatform(int theRmiServerPortPlatform) { - rmiServerPortPlatform = theRmiServerPortPlatform; - } - - /** - * Get the port on which the Platform RMI registry is exported. - * @return The port number - */ - public int getRmiRegistryPortPlatform() { - return rmiRegistryPortPlatform; - } - - /** - * Set the port on which the Platform RMI registry is exported. - * @param theRmiRegistryPortPlatform The port number - */ - public void setRmiRegistryPortPlatform(int theRmiRegistryPortPlatform) { - rmiRegistryPortPlatform = theRmiRegistryPortPlatform; - } - - /** - * Get the flag that indicates that local ports should be used for all - * connections. If using SSH tunnels, or similar, this should be set to - * true to ensure the RMI client uses the tunnel. - * @return <code>true</code> if local ports should be used - */ - public boolean getUseLocalPorts() { - return useLocalPorts; - } - - /** - * Set the flag that indicates that local ports should be used for all - * connections. If using SSH tunnels, or similar, this should be set to - * true to ensure the RMI client uses the tunnel. - * @param useLocalPorts Set to <code>true</code> if local ports should be - * used - */ - public void setUseLocalPorts(boolean useLocalPorts) { - this.useLocalPorts = useLocalPorts; - } - - private void init() { - // Get all the other parameters required from the standard system - // properties. Only need to get the parameters that affect the creation - // of the server port. - String rmiRegistrySSLValue = System.getProperty( - "com.sun.management.jmxremote.registry.ssl", "false"); - rmiRegistrySSL = Boolean.parseBoolean(rmiRegistrySSLValue); - - String rmiServerSSLValue = System.getProperty( - "com.sun.management.jmxremote.ssl", "true"); - rmiServerSSL = Boolean.parseBoolean(rmiServerSSLValue); - - String protocolsValue = System.getProperty( - "com.sun.management.jmxremote.ssl.enabled.protocols"); - if (protocolsValue != null) { - protocols = protocolsValue.split(","); - } - - String ciphersValue = System.getProperty( - "com.sun.management.jmxremote.ssl.enabled.cipher.suites"); - if (ciphersValue != null) { - ciphers = ciphersValue.split(","); - } - - String clientAuthValue = System.getProperty( - "com.sun.management.jmxremote.ssl.need.client.auth", "true"); - clientAuth = Boolean.parseBoolean(clientAuthValue); - - String authenticateValue = System.getProperty( - "com.sun.management.jmxremote.authenticate", "true"); - authenticate = Boolean.parseBoolean(authenticateValue); - - passwordFile = System.getProperty( - "com.sun.management.jmxremote.password.file", - "jmxremote.password"); - - accessFile = System.getProperty( - "com.sun.management.jmxremote.access.file", - "jmxremote.access"); - - loginModuleName = System.getProperty( - "com.sun.management.jmxremote.login.config"); - } - - - @Override - public void lifecycleEvent(LifecycleEvent event) { - if (Lifecycle.BEFORE_INIT_EVENT.equals(event.getType())) { - log.warn(sm.getString("jmxRemoteLifecycleListener.deprecated")); - } else if (Lifecycle.START_EVENT.equals(event.getType())) { - // When the server starts, configure JMX/RMI - - // Configure using standard JMX system properties - init(); - - // Prevent an attacker guessing the RMI object ID - System.setProperty("java.rmi.server.randomIDs", "true"); - - // Create the environment - HashMap<String,Object> env = new HashMap<>(); - - RMIClientSocketFactory registryCsf = null; - RMIServerSocketFactory registrySsf = null; - - RMIClientSocketFactory serverCsf = null; - RMIServerSocketFactory serverSsf = null; - - // Configure registry socket factories - if (rmiRegistrySSL) { - registryCsf = new SslRMIClientSocketFactory(); - if (rmiBindAddress == null) { - registrySsf = new SslRMIServerSocketFactory( - ciphers, protocols, clientAuth); - } else { - registrySsf = new SslRmiServerBindSocketFactory( - ciphers, protocols, clientAuth, rmiBindAddress); - } - } else { - if (rmiBindAddress != null) { - registrySsf = new RmiServerBindSocketFactory(rmiBindAddress); - } - } - - // Configure server socket factories - if (rmiServerSSL) { - serverCsf = new SslRMIClientSocketFactory(); - if (rmiBindAddress == null) { - serverSsf = new SslRMIServerSocketFactory( - ciphers, protocols, clientAuth); - } else { - serverSsf = new SslRmiServerBindSocketFactory( - ciphers, protocols, clientAuth, rmiBindAddress); - } - } else { - if (rmiBindAddress != null) { - serverSsf = new RmiServerBindSocketFactory(rmiBindAddress); - } - } - - // By default, the registry will pick an address to listen on. - // Setting this property overrides that and ensures it listens on - // the configured address. - if (rmiBindAddress != null) { - System.setProperty("java.rmi.server.hostname", rmiBindAddress); - } - - // Force the use of local ports if required - if (useLocalPorts) { - registryCsf = new RmiClientLocalhostSocketFactory(registryCsf); - serverCsf = new RmiClientLocalhostSocketFactory(serverCsf); - } - - env.put("jmx.remote.rmi.server.credential.types", new String[] { - String[].class.getName(), - String.class.getName() }); - - // Populate the env properties used to create the server - if (serverCsf != null) { - env.put(RMIConnectorServer.RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE, serverCsf); - env.put("com.sun.jndi.rmi.factory.socket", registryCsf); - } - if (serverSsf != null) { - env.put(RMIConnectorServer.RMI_SERVER_SOCKET_FACTORY_ATTRIBUTE, serverSsf); - } - - // Configure authentication - if (authenticate) { - env.put("jmx.remote.x.password.file", passwordFile); - env.put("jmx.remote.x.access.file", accessFile); - env.put("jmx.remote.x.login.config", loginModuleName); - } - - // Create the Platform server - csPlatform = createServer("Platform", rmiBindAddress, rmiRegistryPortPlatform, - rmiServerPortPlatform, env, registryCsf, registrySsf, serverCsf, serverSsf); - - } else if (Lifecycle.STOP_EVENT.equals(event.getType())) { - destroyServer("Platform", csPlatform); - } - } - - - private JMXConnectorServer createServer(String serverName, - String bindAddress, int theRmiRegistryPort, int theRmiServerPort, - HashMap<String,Object> theEnv, - RMIClientSocketFactory registryCsf, RMIServerSocketFactory registrySsf, - RMIClientSocketFactory serverCsf, RMIServerSocketFactory serverSsf) { - - if (bindAddress == null) { - bindAddress = "localhost"; - } - - String url = "service:jmx:rmi://" + bindAddress; - JMXServiceURL serviceUrl; - try { - serviceUrl = new JMXServiceURL(url); - } catch (MalformedURLException e) { - log.error(sm.getString("jmxRemoteLifecycleListener.invalidURL", serverName, url), e); - return null; - } - - RMIConnectorServer cs = null; - try { - RMIJRMPServerImpl server = new RMIJRMPServerImpl( - rmiServerPortPlatform, serverCsf, serverSsf, theEnv); - cs = new RMIConnectorServer(serviceUrl, theEnv, server, - ManagementFactory.getPlatformMBeanServer()); - cs.start(); - Remote jmxServer = server.toStub(); - // Create the RMI registry - try { - /* - * JmxRegistry is registered as a side-effect of creation. - * This object is here so we can tell the IDE it is OK for it - * not to be used. - */ - @SuppressWarnings("unused") - JmxRegistry unused = new JmxRegistry(theRmiRegistryPort, registryCsf, registrySsf, "jmxrmi", jmxServer); - } catch (RemoteException e) { - log.error(sm.getString( - "jmxRemoteLifecycleListener.createRegistryFailed", - serverName, Integer.toString(theRmiRegistryPort)), e); - return null; - } - log.info(sm.getString("jmxRemoteLifecycleListener.start", - Integer.toString(theRmiRegistryPort), - Integer.toString(theRmiServerPort), serverName)); - } catch (IOException e) { - log.error(sm.getString( - "jmxRemoteLifecycleListener.createServerFailed", - serverName), e); - } - return cs; - } - - - private void destroyServer(String serverName, - JMXConnectorServer theConnectorServer) { - if (theConnectorServer != null) { - try { - theConnectorServer.stop(); - } catch (IOException e) { - log.error(sm.getString( - "jmxRemoteLifecycleListener.destroyServerFailed", - serverName),e); - } - } - } - - - public static class RmiClientLocalhostSocketFactory - implements RMIClientSocketFactory, Serializable { - - private static final long serialVersionUID = 1L; - - private static final String FORCED_HOST = "localhost"; - - private final RMIClientSocketFactory factory; - - public RmiClientLocalhostSocketFactory(RMIClientSocketFactory theFactory) { - factory = theFactory; - } - - @Override - public Socket createSocket(String host, int port) throws IOException { - if (factory == null) { - return new Socket(FORCED_HOST, port); - } else { - return factory.createSocket(FORCED_HOST, port); - } - } - } - - - public static class RmiServerBindSocketFactory implements RMIServerSocketFactory { - - private final InetAddress bindAddress; - - public RmiServerBindSocketFactory(String address) { - InetAddress bindAddress = null; - try { - bindAddress = InetAddress.getByName(address); - } catch (UnknownHostException e) { - log.error(sm.getString( - "jmxRemoteLifecycleListener.invalidRmiBindAddress", address), e); - // bind address will be null which means any/all local addresses - // which should be safe - } - this.bindAddress = bindAddress; - } - - @Override - public ServerSocket createServerSocket(int port) throws IOException { - return new ServerSocket(port, 0, bindAddress); - } - } - - - public static class SslRmiServerBindSocketFactory extends SslRMIServerSocketFactory { - - private static final SSLServerSocketFactory sslServerSocketFactory; - private static final String[] defaultProtocols; - - static { - SSLContext sslContext; - try { - sslContext = SSLContext.getDefault(); - } catch (NoSuchAlgorithmException e) { - // Can't continue. Force a failure. - throw new IllegalStateException(e); - } - sslServerSocketFactory = sslContext.getServerSocketFactory(); - String[] protocols = sslContext.getDefaultSSLParameters().getProtocols(); - List<String> filteredProtocols = new ArrayList<>(protocols.length); - for (String protocol : protocols) { - if (protocol.toUpperCase(Locale.ENGLISH).contains("SSL")) { - continue; - } - filteredProtocols.add(protocol); - } - defaultProtocols = filteredProtocols.toArray(new String[filteredProtocols.size()]); - } - - private final InetAddress bindAddress; - - public SslRmiServerBindSocketFactory(String[] enabledCipherSuites, - String[] enabledProtocols, boolean needClientAuth, String address) { - super(enabledCipherSuites, enabledProtocols, needClientAuth); - InetAddress bindAddress = null; - try { - bindAddress = InetAddress.getByName(address); - } catch (UnknownHostException e) { - log.error(sm.getString( - "jmxRemoteLifecycleListener.invalidRmiBindAddress", address), e); - // bind address will be null which means any/all local addresses - // which should be safe - } - this.bindAddress = bindAddress; - } - - @Override - public ServerSocket createServerSocket(int port) throws IOException { - SSLServerSocket sslServerSocket = - (SSLServerSocket) sslServerSocketFactory.createServerSocket(port, 0, bindAddress); - if (getEnabledCipherSuites() != null) { - sslServerSocket.setEnabledCipherSuites(getEnabledCipherSuites()); - } - if (getEnabledProtocols() == null) { - sslServerSocket.setEnabledProtocols(defaultProtocols); - } else { - sslServerSocket.setEnabledProtocols(getEnabledProtocols()); - } - sslServerSocket.setNeedClientAuth(getNeedClientAuth()); - return sslServerSocket; - } - - // Super class defines hashCode() and equals(). Probably not used in - // Tomcat but for safety, override them here. - @Override - public int hashCode() { - final int prime = 31; - int result = super.hashCode(); - result = prime * result + ((bindAddress == null) ? 0 : bindAddress.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (!super.equals(obj)) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - SslRmiServerBindSocketFactory other = (SslRmiServerBindSocketFactory) obj; - if (bindAddress == null) { - if (other.bindAddress != null) { - return false; - } - } else if (!bindAddress.equals(other.bindAddress)) { - return false; - } - return true; - } - } - - - /* - * Better to use the internal API than re-invent the wheel. - */ - @SuppressWarnings("restriction") - private static class JmxRegistry extends sun.rmi.registry.RegistryImpl { - private static final long serialVersionUID = -3772054804656428217L; - private final String jmxName; - private final Remote jmxServer; - public JmxRegistry(int port, RMIClientSocketFactory csf, - RMIServerSocketFactory ssf, String jmxName, Remote jmxServer) throws RemoteException { - super(port, csf, ssf); - this.jmxName = jmxName; - this.jmxServer = jmxServer; - } - @Override - public Remote lookup(String name) - throws RemoteException, NotBoundException { - return (jmxName.equals(name)) ? jmxServer : null; - } - @Override - public void bind(String name, Remote obj) - throws RemoteException, AlreadyBoundException, AccessException { - } - @Override - public void unbind(String name) - throws RemoteException, NotBoundException, AccessException { - } - @Override - public void rebind(String name, Remote obj) - throws RemoteException, AccessException { - } - @Override - public String[] list() throws RemoteException { - return new String[] { jmxName }; - } - } - -} diff --git a/java/org/apache/catalina/mbeans/LocalStrings.properties b/java/org/apache/catalina/mbeans/LocalStrings.properties index b6ea0d3..4176cbf 100644 --- a/java/org/apache/catalina/mbeans/LocalStrings.properties +++ b/java/org/apache/catalina/mbeans/LocalStrings.properties @@ -13,14 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -jmxRemoteLifecycleListener.createRegistryFailed=Unable to create the RMI registry for the [{0}] server using port [{1}] -jmxRemoteLifecycleListener.createServerFailed=The JMX connector server could not be created or failed to start for the [{0}] server -jmxRemoteLifecycleListener.deprecated=The JmxRemoteLifecycleListener is deprecated as as the features it provides are now available in the remote JMX capability included with the JRE. This listener will be removed in Tomcat 10 and may be removed from Tomcat 8 some time after 2020-12-31. -jmxRemoteLifecycleListener.destroyServerFailed=The JMX connector server could not be stopped for the [{0}] server -jmxRemoteLifecycleListener.invalidRmiBindAddress=Invalid RMI bind address [{0}] -jmxRemoteLifecycleListener.invalidURL=The JMX Service URL requested for the [{0}] server, [{1}], was invalid -jmxRemoteLifecycleListener.start=The JMX Remote Listener has configured the registry on port [{0}] and the server on port [{1}] for the [{2}] server - mBeanFactory.contextCreate.addServicedFail=Unable to create context [{0}] as another component is currently servicing a context with that name mBeanFactory.contextRemove.addServicedFail=Unable to remove context [{0}] as another component is currently servicing that context mBeanFactory.managerContext=Manager components may only be added to Contexts. diff --git a/java/org/apache/catalina/mbeans/LocalStrings_es.properties b/java/org/apache/catalina/mbeans/LocalStrings_es.properties deleted file mode 100644 index b09f904..0000000 --- a/java/org/apache/catalina/mbeans/LocalStrings_es.properties +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -jmxRemoteLifecycleListener.invalidURL=LA URL del servicio JMX solicitada por el servidor [{0}], [{1}], fue no válida diff --git a/java/org/apache/catalina/mbeans/LocalStrings_fr.properties b/java/org/apache/catalina/mbeans/LocalStrings_fr.properties index 05ca393..9df7bba 100644 --- a/java/org/apache/catalina/mbeans/LocalStrings_fr.properties +++ b/java/org/apache/catalina/mbeans/LocalStrings_fr.properties @@ -13,13 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -jmxRemoteLifecycleListener.createRegistryFailed=Création du répertoire RMI impossible pour le serveur [{0}] utilisant le port [{1}] -jmxRemoteLifecycleListener.createServerFailed=Le connecteur serveur JMX pour le serveur [{0}] n''a pas pu être créé ou n''a pas pu démarrer -jmxRemoteLifecycleListener.destroyServerFailed=Le connecteur serveur JMX pour le serveur [{0}] n''a pas pu être stoppé -jmxRemoteLifecycleListener.invalidRmiBindAddress=Adresse d''association du RMI invalide [{0}] -jmxRemoteLifecycleListener.invalidURL=L''URL demandée pour le serveur [{0}], [{1}], est incorrect -jmxRemoteLifecycleListener.start=L''écouteur distant JMX a configuré le répertoire sur le port [{0}] et le serveur sur le port [{1}] pour le serveur [{2}] - mBeanFactory.contextCreate.addServicedFail=Impossible de créer le contexte [{0}] car un autre composant est en train d''effectuer des opérations de service avec ce nom mBeanFactory.contextRemove.addServicedFail=Impossible de supprimer le contexte [{0}] car un autre composant est en train d''effectuer des opérations de service avec ce nom mBeanFactory.managerContext=Un gestionnaire de sessions ne peut être ajouté qu'à un contexte diff --git a/java/org/apache/catalina/mbeans/LocalStrings_ja.properties b/java/org/apache/catalina/mbeans/LocalStrings_ja.properties index 222668f..bedf1f2 100644 --- a/java/org/apache/catalina/mbeans/LocalStrings_ja.properties +++ b/java/org/apache/catalina/mbeans/LocalStrings_ja.properties @@ -13,13 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -jmxRemoteLifecycleListener.createRegistryFailed=ポート[{1}]を使用して[{0}]サーバーのRMIレジストリを作成できません -jmxRemoteLifecycleListener.createServerFailed=[{0}]サーバーのJMXコネクタサーバーを作成できなかったか、または開始できませんでした -jmxRemoteLifecycleListener.destroyServerFailed=[{0}]サーバーのJMXコネクタサーバーを停止できませんでした。 -jmxRemoteLifecycleListener.invalidRmiBindAddress=無効なRMIバインドアドレス[{0}] -jmxRemoteLifecycleListener.invalidURL=[{0}] サーバーに不正な JMX サービスリクエスト [{1}] が要求されました。 -jmxRemoteLifecycleListener.start=サーバー [{2}] の JMX リモートリスナーをレジストリーポート番号 [{0}] サーバーポート番号 [{1}] で構成しました。 - mBeanFactory.contextCreate.addServicedFail=別のコンポーネントが現在その名前のコンテキストを処理しているため、コンテキスト [{0}] を作成できません mBeanFactory.contextRemove.addServicedFail=別のコンポーネントが現在そのコンテキストを処理しているため、コンテキスト [{0}] を削除できません mBeanFactory.managerContext=ManagerコンポーネントはContextにのみ追加できます。 diff --git a/java/org/apache/catalina/mbeans/LocalStrings_ko.properties b/java/org/apache/catalina/mbeans/LocalStrings_ko.properties index 730e6f0a..aa31ff5 100644 --- a/java/org/apache/catalina/mbeans/LocalStrings_ko.properties +++ b/java/org/apache/catalina/mbeans/LocalStrings_ko.properties @@ -13,13 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -jmxRemoteLifecycleListener.createRegistryFailed=[{0}] 서버를 위한 RMI 레지스트리를, 포트 번호 [{1}]을(를) 사용하여 생성할 수 없습니다. -jmxRemoteLifecycleListener.createServerFailed=JMX connector 서버가 생성될 수 없었거나, [{0}] 서버를 위해 시작되지 못했습니다. -jmxRemoteLifecycleListener.destroyServerFailed=[{0}] 서버를 위해, JMX connector 서버가 중지될 수 없었습니다. -jmxRemoteLifecycleListener.invalidRmiBindAddress=유효하지 않은 RMI 바인딩 주소 [{0}] -jmxRemoteLifecycleListener.invalidURL=[{0}] 서버에 요청하는 JMX 서비스 URL [{1}]은(는) 유효하지 않습니다. -jmxRemoteLifecycleListener.start=[{2}] 서버를 위하여, JMX 원격 리스너가 포트 [{0}]에 레지스트리를 설정했으며, 포트 [{1}]에 서버를 설정했습니다. - mBeanFactory.contextCreate.addServicedFail=다른 구성요소가 한 컨텍스트를 해당 이름으로 현재 서비스 중이므로, 컨텍스트 [{0}]을(를) 생성할 수 없습니다. mBeanFactory.contextRemove.addServicedFail=다른 구성요소가 해당 컨텍스트를 현재 서비스 중이므로, 컨텍스트 [{0}]을(를) 제거할 수 없습니다. mBeanFactory.managerContext=매니저 구성요소들은 컨텍스트들에만 추가될 수 있습니다. diff --git a/java/org/apache/catalina/mbeans/LocalStrings_zh_CN.properties b/java/org/apache/catalina/mbeans/LocalStrings_zh_CN.properties index 72165c1..785e2c5 100644 --- a/java/org/apache/catalina/mbeans/LocalStrings_zh_CN.properties +++ b/java/org/apache/catalina/mbeans/LocalStrings_zh_CN.properties @@ -13,10 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -jmxRemoteLifecycleListener.createRegistryFailed=无法使用端口[{1}]为[{0}]服务器创建RMI注册表 -jmxRemoteLifecycleListener.createServerFailed=无法为[{0}]服务器创建JMX连接器服务器或启动失败 -jmxRemoteLifecycleListener.invalidURL=为[{0}]服务器[{1}]请求的JMX服务URL无效 - mBeanFactory.contextCreate.addServicedFail=无法创建上下文[{0}],因为另一个组件正在为具有该名称的上下文提供服务 mBeanFactory.contextRemove.addServicedFail=无法移除上下文[{0}],因为另一个组件正在为具有该名称的上下文提供服务 mBeanFactory.managerContext=管理器组件只能添加到上下文中。 diff --git a/res/spotbugs/filter-false-positives.xml b/res/spotbugs/filter-false-positives.xml index 6527fd8..cd268c8 100644 --- a/res/spotbugs/filter-false-positives.xml +++ b/res/spotbugs/filter-false-positives.xml @@ -379,12 +379,6 @@ <Bug pattern="DCN_NULLPOINTER_EXCEPTION" /> </Match> <Match> - <!-- Object is used via side-effect of creation. --> - <Class name="org.apache.catalina.mbeans.JmxRemoteLifecycleListener" /> - <Method name="createServer" /> - <Bug pattern="DLS_DEAD_LOCAL_STORE" /> - </Match> - <Match> <!-- SQL construction is safe since it is from trusted config --> <Or> <Class name="org.apache.catalina.realm.DataSourceRealm" /> diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 811d8f9..d7ede19 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -142,6 +142,9 @@ Add recycling check in the input and output stream isReady to try to give a more informative ISE when the facade has been recycled. (remm) </fix> + <update> + Remove the deprecated <code>JmxRemoteLifecycleListener</code>. (markt) + </update> </changelog> </subsection> <subsection name="Coyote"> diff --git a/webapps/docs/config/listeners.xml b/webapps/docs/config/listeners.xml index ad65e5e..4a636e8 100644 --- a/webapps/docs/config/listeners.xml +++ b/webapps/docs/config/listeners.xml @@ -547,113 +547,6 @@ </section> -<section name="Deprecated Implementations"> - - <subsection name="JMX Remote Lifecycle Listener - org.apache.catalina.mbeans.JmxRemoteLifecycleListener"> - - <p><strong>This listener is now deprecated as the features it provides are - now available in the remote JMX capability included with the JRE. This - listener will be removed in Tomcat 10 and may be removed from Tomcat 8 some - time after 2020-12-31.</strong></p> - - <p>This listener requires <code>catalina-jmx-remote.jar</code> to be placed - in <code>$CATALINA_HOME/lib</code>. This jar may be found in the extras - directory of the binary download area.</p> - - <p>The <strong>JMX Remote Lifecycle Listener</strong> fixes the ports used by - the JMX/RMI Server making things much simpler if you need to connect - jconsole or a similar tool to a remote Tomcat instance that is running - behind a firewall. Only these ports are configured via the listener. The - remainder of the configuration is via the standard system properties for - configuring JMX. For further information on configuring JMX see - <a href="http://docs.oracle.com/javase/6/docs/technotes/guides/management/agent.html"> - Monitoring and Management Using JMX</a> included with the Java SDK - documentation.</p> - - <p>This listener must only be nested within a <a href="server.html">Server</a> - element.</p> - - <p>The following additional attributes are supported by the <strong>JMX Remote - Lifecycle Listener</strong>:</p> - - <attributes> - - <attribute name="rmiRegistryPortPlatform" required="true"> - <p>The port to be used by the JMX/RMI registry for the Platform MBeans. - This replaces the use of the - <code>com.sun.management.jmxremote.port</code> system property that - should not be set when using this listener.</p> - </attribute> - - <attribute name="rmiServerPortPlatform" required="true"> - <p>The port to be used by the Platform JMX/RMI server.</p> - </attribute> - - <attribute name="rmiBindAddress" required="false"> - <p>The address of the interface to be used by JMX/RMI server.</p> - </attribute> - - <attribute name="useLocalPorts" required="false"> - <p>Should any clients using these ports be forced to use local ports to - connect to the JMX/RMI server. This is useful when tunnelling - connections over SSH or similar. Defaults to <code>false</code>.</p> - </attribute> - - </attributes> - - <h3>Using file-based Authentication and Authorisation</h3> - - <p>If this listener was configured in server.xml as:</p> - <source><![CDATA[ <Listener className="org.apache.catalina.mbeans.JmxRemoteLifecycleListener" - rmiRegistryPortPlatform="10001" rmiServerPortPlatform="10002" />]]></source> - <p>with the following system properties set (e.g. in setenv.sh):</p> - <source> -Dcom.sun.management.jmxremote.password.file=$CATALINA_BASE/conf/jmxremote.password - -Dcom.sun.management.jmxremote.access.file=$CATALINA_BASE/conf/jmxremote.access - -Dcom.sun.management.jmxremote.ssl=false</source> - <p>$CATALINA_BASE/conf/jmxremote.password containing:</p> - <source>admin letmein</source> - <p>$CATALINA_BASE/conf/jmxremote.access containing:</p> - <source>admin readwrite</source> - <p>then opening ports 10001 (RMI Registry) and 10002 (JMX/RMI Server) in your - firewall would enable jconsole to connect to a Tomcat instance running - behind a firewall using a connection string of the form:</p> - <source>service:jmx:rmi://<hostname>:10002/jndi/rmi://<hostname>:10001/jmxrmi</source> - <p> - with a user name of <code>admin</code> and a password of - <code>letmein</code>. - </p> - - <h3>Using JAAS</h3> - - <p>If we use the following system properties instead:</p> - <source> -Dcom.sun.management.jmxremote.login.config=Tomcat - -Djava.security.auth.login.config=$CATALINA_BASE/conf/login.config - -Dcom.sun.management.jmxremote.access.file=$CATALINA_BASE/conf/jmxremote.access - -Dcom.sun.management.jmxremote.ssl=false</source> - <p>$CATALINA_BASE/conf/login.config containing your choice of JAAS LoginModule implementation, for example:</p> - <source> Tomcat { /* should match to the com.sun.management.jmxremote.login.config property */ - - /* for illustration purposes only */ - com.sun.security.auth.module.LdapLoginModule REQUIRED - userProvider="ldap://ldap-svr/ou=people,dc=example,dc=com" - userFilter="(&(uid={USERNAME})(objectClass=inetOrgPerson))" - authzIdentity="admin" - debug=true; - };</source> - <p>$CATALINA_BASE/conf/jmxremote.access containing:</p> - <source>admin readwrite</source> - <p> - then we would need to provide LDAP credentials instead. - </p> - - <p><strong>Note that the examples above do not use SSL. JMX access should - be considered equivalent to administrative access and secured accordingly. - </strong></p> - - </subsection> - -</section> - </body> </document> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org