Address is invalid on local machine, or port is not valid on remote machine
search cancel

Address is invalid on local machine, or port is not valid on remote machine

book

Article ID: 225171

calendar_today

Updated On:

Products

CA Automic Applications Manager (AM)

Issue/Introduction

Attempting to log into the Java Client can result in the below error:

ErrorMsg: AwE-5009 RMI connection failure, check if RmiServer is running
Details: null
java.net.ConnectException: connect: Address is invalid on local machine, or port is not valid on remote machine

While this error can be caused by multiple reasons, one of the reasons this error is seen when a ClientRMIPortNumber is defined (in cases where a firewall exists), is when this connection is hung or still active.

Finding and closing the connection should resolve the issue.

Environment

Release : 9.3x, 9.4x, 9.5x

Component : APPLICATIONS MANAGER

Resolution

Check if there is a stuck/active connection on the User PC or the master and kill the connection.

From the User's PC, open a cmd prompt and check to see if there is a stuck/active connection to the master by running the below command:

netstat -ano | findstr <master IP address>

Below is an example:
C:\Users\USER1>netstat -ano|findstr 10.0.0.1
  TCP    10.0.0.1:53728    10.0.0.1:1099      ESTABLISHED     16976

The result format is in:
TCP <local PC IP address>:<ClientRMIPortNumber>     <master IP address>:<RmiRegistryPort>    ESTABLISHED   <Process ID>

If a connection is found using the netstat command, the easiest way to kill the connection, is to end the process from Windows Task Manager:

 

To check if there is a stuck/active connection on the master, run the below command after logging into the master:

command is netstat -ano | grep <ip address of User PC>

example:
[xxx@yyyyyy ~]$ netstat -ano | grep 10.0.0.1
tcp6       0      0 10.0.0.1:1099       10.0.0.1:53728     ESTABLISHED off (0.00/0/0)

The IP address of the User PC can be found in the client.log file, found in the log directory located in the same directory as the RunClient.jar. Below is a snippet of a client.log file where the Connection error occurs:

 AWT-EventQueue-0: .ClientSocketManager: createSocket 10.0.0.1.9:1099 from A123456B/10.0.0.1:8097
 AWT-EventQueue-0: .AxOptions: SSL=off
 AWT-EventQueue-0: .ClientSocketManager: A123456B/10.0.0.1 java.net.ConnectException: Connection timed out: connect
 AWT-EventQueue-0: .ClientSocketManager: createSocket 10.0.0.1:1099 from A123456B/10.0.0.1:8097
 AWT-EventQueue-0: .AxOptions: SSL=off
 AWT-EventQueue-0: .ClientSocketManager: A123456B/10.0.0.1 java.net.ConnectException: Connection timed out: connect
 AWT-EventQueue-0: .ClientSocketManager: createSocket 10.0.0.1:1099 from A123456B/0:0:0:0:0:0:0:1:8097
AWT-EventQueue-0: .AxOptions: SSL=off
 AWT-EventQueue-0: .ClientSocketManager: A123456B/0:0:0:0:0:0:0:1 java.net.ConnectException: connect: Address is invalid on local machine, or port is not valid on remote machine
 AWT-EventQueue-0: .ErrorMsg: Error #: AwE-5009
 AWT-EventQueue-0: .AxOptions: NoErrorMsgProperties=false
ErrorMsg: AwE-5009 RMI connection failure, check if RmiServer is running Details: null
java.net.ConnectException: connect: Address is invalid on local machine, or port is not valid on remote machine

In the above log snippet, the highlighted IP address is the IP address of the User PC. A user's PC may have multiple IP addresses. Run the above netstat command replacing "<ip address of User PC>" with the actual IP address of the User PC. The command needs to be for each different IP address.

If a connection is found, the connection can be killed by running the below command:

tcpkill host <ip address of User PC

 

Once connection(s) are killed, attempt to Lon in once more.