3 Replies Latest reply on Jul 13, 2002 5:06 AM by Thomas Peuss

    Clustered Rmi Service - How-to - Solutions

    Robert Caranica Newbie

      (I made a new topic, as I couldn't post to my old topic... very strange)

      Ok. I've investigated the problem a little further, as I got no replies on the forum :(

      So far this is how one can get a RMI service clustered:

      The code in the section (1.G.II.d) on HA-RMI, from the "Jboss 3.0 Clustering Document" has to be used. Unfortunately this point was not very explicit in that document and basically I had to try every solution that I could think of. The downside is that this code is very AS-specific, making clustering setup for RMI not transparent as opposed to clustering for EJBs, where we don't have to modify the code, but merely edit some deployment descriptors.

      Now, if you're not interested in clustering, but still want RMI, there are a number of solutions:

      1) The RMI service registers itself to JNDI via context.bind(). (when the cluster is setup, JDNI lookup failover is available though. Not sure how useful this is, but I've mentioned it anyway). Client access the service via JNDI.

      2) Do it the old fashioned way, with

      Registry registry = LocateRegistry.getRegistry();
      and then bind() the service to the registry.

      Client needs stub for jdk < 1.2 or it can download it if the policy file permits this.

      Now, the problem is how to make the registry start when the server starts. One solution is from a servlet which is loaded on startup by jetty (inside jboss). Not an elegant solution, but at least it works. In my opinion a nicer way to do this should be made available to the user, although we tend to drop RMI in favor of EJBs and other stuff that uses RMI as transport. RMI must still be ready-to-use in a modern AS, along side "bleeding edge" technologies ;).