RMI Connectivity Issues
|COMP 310 Java Resources Eclipse Resources|
(Back to the RMI Overview)
Solving RMI connectivity issues can be tricky. Here are some things to keep in mind and some tactics to try.
Highly recommended: Tell your laptop to "forget" the Rice Visitor network so that it never attempts to connect to it!
Most RMI connectivity issues relate to blocked ports. Be sure you know all the ports that your RMI program uses. RMI needs ports open for at least the following:
Registry -- the Java default Registry port is 1099, but Comp310 tends to use 2099 to avoid conflicts with other RMI-based programs such as DrJava.
Class File Server(s) -- The class file server supports dynamic class loading. If you have two parts to your application that you wish or are able to run simultaneously on your computer, there may be at least two class file servers running at once. Typical ports used in Comp310 for the class servers are ports 2001 - 2003.
All RMI "stubs" have a port associated with them -- It is best to explicitly specifiy the port when you create the stub rather than let Java pick a random port. That way you can be sure that the port is open through your firewall. We tend to use ports 2100-2102 for general purpose stubs but check with your particular application to make sure you know what port ranges you must deal with!
Make sure that your network is not designated as "Public" (Windows only)
On Windows machines, if your network is set to "Public", you may experience problems ranging from slow connections to intermittent lack of packet transfer. You should always have your network set to "Private" or "Home" or "Work".
You need to change the "Network Location" to private. This can be done either by partially setting up a "Home Group" or by enabling sharing.
The above links detail directions on how to perform the changes, which differ depending on whether you are on a wired or wireless network. Changing the network location as part off the Home Group setup is probably the easiest method -- note that the process does NOT require you to actually complete the set up of a new Home Group.
To show all port usage, open a command window and type the following (you will need to enter your password):
sudo lsof -i -n -P
To show all port usage, open a command window "as administrator" and type the following:
netstat -anob -p tcp
A computer runs many programs behind the scenes that can potentially interfere with RMI. It can take a bit of detective work to determine which program is causing any conflicts however, so do not expect this to be a quick solution. Please inform the course staff of whatever you discover as this information could be very important to others with the same problem!
Go to System Preferences then Accounts and then open LoginItems. Click on the lock icon in the lower-left corner and enter your administrator password. Highlighting a potentially conflicting program and clicking the "-" button will remove it from teh startup queue and it will not be running when you restart the system. Suggestion: write down the names and locations of the programs that you are removing so you can replace them later if they aren't causing the problem.
Startup programs can be found in 3 different non-distinct places in Windows:
In the taskbar area at the lower right of the screen. Try exiting the various programs that appear here. Note that in general, this will only temporarily disable the programs as they will re-appear when the system is restarted unless their preferences are changed to prevent the auto-start.
The Startup folder in Start menu (Windows 7 and before) -- copy these items out this folder to somewhere else, e.g. your desktop, and then restart your system to see if they have an effect.
The Startup tab in msconfig. In the textfield of the Start menu of Windows 7 (or before) or in the Start tiles area of Windows 8, type msconfig.exe and run it. In Win8, this will lead you to the Startup tab in the Task Manager, to which you could also go directly. Startup programs can be disabled here. Be careful though, as some programs are critical to stable system operation.
Sometimes RMI only works if Chrome is not running . This may be due to a plugin in Chrome using the ports. If you are running a Mac, please send the staff an e-mail telling us if you were able or not able to run the RMIHelloWorld code and a list of all the plugins in your Chrome installation.
This tunneling program definitely conflicts with the RMI ports. Disable the application.
If you have ever run VMware on your machine, it may still be active. One possible but not definite clue is that your network connections will show VMware connections along with the WiFi connection. Go to the "Services" app in the Administrative Tools and disable all the services associated with VMware (there's 3-4 of them). Be sure that the services are stopped.
You can get Java to print out more verbose logging information during RMI transactions by setting the following system properties when RMI starts up:
System.setProperty("sun.rmi.loader.logLevel", "verbose"); System.setProperty("sun.rmi.server.logLevel", "verbose"); System.setProperty("sun.rmi.transport.logLevel", "verbose");
Here's a list of all the Java system properties related to RMI: http://docs.oracle.com/javase/7/docs/technotes/guides/rmi/sunrmiproperties.html
© 2020 by Stephen Wong