Plain TCP beats RMI

I’ve been working on a class project that involves a cluster of worker machines.  Just to throw something quick together, I thought I’d use RMI.  Since I could ensure that every machine was running byte-for-byte identical programs, I didn’t think I’d run into class loading issues.  However, I’ve never had good luck with RMI, and it failed again.

Even with my class Worker existing on the client and on the server, and being identical, I’d still get ClassNotFoundExceptions for it.  I also had to manually set the java.rmi.server.hostname and java.rmi.server.codebase properties to get RMI to work at all, since it can’t seem to autodetect these settings.

After a few hours of failure, I gave up and decided to give up and use simple TCP connections to send serialized objects.  Worked like a charm.  Screw you, RMI.

Post a Comment

Your email is never shared. Required fields are marked *

*
*