Latest News

the latest news from our team

RMI Exception

java.rmi.ConnectException Connection refused to host:

The Java Remote Method Invocation (RMI) methods expect that the hostname of the server will resolve to the external IP address system. If the system is configured in a non-standard way, the name can resolve to the localhost (or address. The RMI service is attached to an external IP address and not the internal or loopback address.

Fix: Configure IP and hostname resolution on the server. (The customer may not be able or authorized to do this.)

Workaround 1 – Add the following to the Java start line:


The string sequence $(hostname) can only be used in Unix system shell scripts. Try for the external host name if you use this string. On other systems you may need to use the permanent host address. Using a fixed value of any kind must be done thoughtfully as any change to the name or IP address of the server will also need to be made to the eFORMz startup.

Workaround 2 – Use the Web Server options. All the RMI connections would then be made to localhost ( instead of the outside address.

Note: If the server is behind a firewall that uses Network-Address-Translation (NAT), either of the two workarounds will permit access to the services.

Other Variations

  • Communication  Exception
Error connecting to the Director.
Failed to retrieve RMIServer stub:
Javax.naming.CommunicationException (Root exception is Java.rmi.ConnectIOException: non-JRMP server at remote endpoint)

Java.rmi.ConnectIOException: non-JRMP server at remote endpoint means that a connection was made to something that did not communicate like the Director. Troubleshooting could include the following:

  1. Verify that the Director started. Use the ps -ef command to confirm a copy of Java is running Director.
  2. Check the logs. Did the Director start or is there an exception?
  3. Check the open ports. Use the netstat command with options to show the open ports and what application opened them.


  • Service Unavailable Exception

Error connecting to the Director. Failed to retrieve RMIServer stub: Javax.naming.ServiceUnavailableException (Root exception is Java.rmi.ConnectException: Connection refused to host: localhost: nested exception)

This problem was seen on a Windows system that was recently updated. The following steps resolved the error:

  1. Remove system from the domain and rejoin.
  2. Verify that the eFORMz service runs as Network Service.

Keywords: Failed to Retrieve RMI Server Stub, RMI

Leave a Reply

Your email address will not be published. Required fields are marked *