Support Article
SMA: Connection refused on Tomcat remote node
Summary
User faced the following exception trying to configure a remote PRPC connection from System Management Application (SMA) using Tomcat application server.
Error Messages
com.pega.jmx.ui.util.JMXClientException: Cannot connect to the server with specified settings
Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: your_host.your_domain.org; nested exception is: java.net.ConnectException: Connection refused
Steps to Reproduce
Configure a remote node on SMA URL.
Root Cause
A defect or configuration issue in the operating environment:
SMA use JMX to define connections to Tomcat based remote nodes. Hence, to establish a connection, on the remote node the JMX MBean must be enabled and listening on a public interface.
Resolution
Perform the following local-change:
In order to enable JMX in Tomcat and expose a RMI port for remote connections the following JVM options must be added to the JAVA_OPTS system property present in the setenv.[bat|sh] script contained in the bin directory of the Tomcat installation:
- Dcom.sun.management.jmxremote
- Dcom.sun.management.jmxremote.port=<your_port>
- Dcom.sun.management.jmxremote.local.only=false
- Dcom.sun.management.jmxremote.authenticate=false
- Dcom.sun.management.jmxremote.ssl=false
- Djava.rmi.server.hostname=<your hostname>
E.g (Using 9999 as a random port number):
export JAVA_OPTS=-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9999 -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=my_host.my_domain.org
To troubleshoot connection issues:
- Use netstat command to check if the process is listening on the specified port. For example:
...
tcp6 0 0 :::9999 :::* LISTEN 15833/java
3. Test the remote connection using JConsole. If user is able to connect to using JConsole then the connection should be possible from SMA as well.
Published October 21, 2016 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.