1

I can't seem to connect 2 machines using RMI. To make sure there wasn't something wrong with my code I copied the simple example from wikipedia (http://en.wikipedia.org/wiki/Java_remote_method_invocation) and I edited the code to print out a simple int.

I tried giving all permissions and turning all the firewalls off and I still get this error:

java.rmi.ConnectException: Connection refused to host 55.229.xx.xxx; nested 
exception is:java.net.ConnectException: Connection timed out: connect

I've been trying to do this for the past 3 days and I still can't seem to get past basic configuration problems.

spacitron
  • 2,095
  • 7
  • 30
  • 39

2 Answers2

5

The Problem could be your RMI server is sending back its local address, instead of WAN address.

System.setProperty("java.rmi.server.hostname", *host IP*);

also take a look at security policies regarding RMI: http://docs.oracle.com/javase/tutorial/rmi/running.html

sigi
  • 189
  • 3
  • 9
0

Check your firewall settings on your aws instance RMI is running on 1099 port by default as i remember.

sigi
  • 189
  • 3
  • 9