Cannot use RMI after MacOS update to Mavericks
I have two separate Java EE projects: one server and one client (which is a website). They both run on Spring MVC framework. The server is launched via Spring boot as a Java application. The client runs on a local (127.0.0.1) Tomcat and invokes distant method located on the server via RMI.
I am now running this little crowd in Eclipse on a Mac mini running Maverick. Everything worked perfectly before the upgrade when the Mac Mini was running Lion. The client project cannot launch because it timeouts.
A colleague with the same code does not have any problem on his Windows setup, so did I before the upgrade to Maverick. This leads me to incriminate the OS, but what do YOU think?
I found the solution!
Basically, judging from the posts like this one, the problem isn't so much that RMI doesn't work on OSX Mavericks - it's just really slow.
The problem seems to be that Mavericks doesn't understand that 127.0.0.1 is localhost (no idea why). It seems to attempt searching it for on the internet first.
So the solution is to disconnect the mac from the internet, try the rmi connection (it'll work) and then reconnect it to the internet.
I've tried restarting the Spring boot server, still works. Recompiled code, still works. Restarted Eclipse, still works.
However, I restarted the computer, and it seems to have worked for a while and then stopped. I repeated the above and it works.
I haven't been able to test whether it works when the IP changes, but if it doesn't, I believe the "solution" is the same.