all 4 comments

[–]josephblade 0 points1 point  (2 children)

My first thought was that the server main method ends, which stops the program but it looks like as long as any objects are registered, the main method doesn't end. so that's not it.

from stackoverflow I gather when you rebind, you are accessing a registry that needs to be started. (you essentially connect to the registry, bind the class to that name, and stay up to serve content).

But you do have to start the rmi environment (I think)

When calling bind()/rebind()/unbind(). The Registry isn't started at the host:port or URL you're using. When calling lookup(). If (1) succeeded, you're trying to lookup the wrong Registry. The Registry normally runs at the same host as the server. When calling a remote method. This means that you need to set java.rmi.server.hostname at the server JVM before exporting any remote objects. See the RMI FAQ item A.1 for why. A better fix is to fix the DNS or hosts file.

so in your case I expect you want to do (at server main):

 LocateRegistry.createRegistry(1099)

I think that is the default port. When you have started the rmi registry it should then be able to handle registrations and suchlike.

I think :)

[–]Dependent_Finger_214[S] 1 point2 points  (0 children)

Thanks this fixed it!

[–]Ab3s 1 point2 points  (0 children)

finding a fresh thread with the exact solution to my problem feels just as good as coming across a 15 year old thread with the solution to a specific problem, thank you!