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

    Clustered Rmi Service - How-to - Solutions

    crobert


      (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

      LocateRegistry.createRegistry();
      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 ;).

      Robert

        • 1. Re: Clustered Rmi Service - How-to - Solutions
          derry

          I don't know what you want to do. JNDI is a complete replacement for the rmiregistry thing.

          If you don't use EJBs - why do you want to use an application server? If you don't need it - don't use it. This saves you a lot complexity.

          CU
          Thomas

          • 2. Re: Clustered Rmi Service - How-to - Solutions
            crobert


            Thomas,

            What I wanted to do is to be able to offer jdk1.1.x clients access to EJBs ("why" you ask... trust me, you don't what to know).. simply by providing a RMI facade to EJBs.

            And as I said in one of my last posts, I know that RMI is the base for such "new" and "exciting" technologies :-> like EJBs, but I should be able to use it directly from a modern application server. I don't think that's too much to ask :->

            Thanks for your reply anyway.

            Robert

            • 3. Re: Clustered Rmi Service - How-to - Solutions
              derry

              So I see your problem now... ;-)

              You want to access EJBs with JDK 1.1. Hmmm.

              I think JDK 1.1 is a must - otherwise you would not have asked here...

              CU
              Thomas