RMI with rmiregistry on remote host

Discussion in 'Java' started by Rob Dempster, Oct 8, 2003.

  1. Rob Dempster

    Rob Dempster Guest

    I am trying to get RMI to work with the client, the server and the
    rmiregistry running of disjoint hosts. It is intended that the
    rmiregistry run on the host serving the dynamically downloadable
    classes and stubs.

    I have tried this:

    String name = "Compute";
    try {
    registry =
    LocateRegistry.getRegistry("host.holding.downloadables");
    Compute engine = new ComputeEngine();
    registry.rebind("compute", engine);
    System.out.println("ComputeEngine bound");
    } catch (Exception e) {
    System.err.println("ComputeEngine exception: " +
    e.getMessage());
    e.printStackTrace();
    }

    but it complains about java.rmi.AccessException:
    Registry.Registry.rebind disallowed;

    Is what I am trying feasible or not.

    Thanks,
    Rob Dempster
     
    Rob Dempster, Oct 8, 2003
    #1
    1. Advertising

  2. Rob Dempster

    Marek Lange Guest

    Rob Dempster wrote:

    > I am trying to get RMI to work with the client, the server and the
    > rmiregistry running of disjoint hosts. It is intended that the
    > rmiregistry run on the host serving the dynamically downloadable
    > classes and stubs.
    >
    > I have tried this:
    >
    > String name = "Compute";
    > try {
    > registry =
    > LocateRegistry.getRegistry("host.holding.downloadables");
    > Compute engine = new ComputeEngine();
    > registry.rebind("compute", engine);
    > System.out.println("ComputeEngine bound");
    > } catch (Exception e) {
    > System.err.println("ComputeEngine exception: " +
    > e.getMessage());
    > e.printStackTrace();
    > }
    >
    > but it complains about java.rmi.AccessException:
    > Registry.Registry.rebind disallowed;


    I believe the reason for this error is that you can only bind objects to
    a local RMI registry.

    -marek
     
    Marek Lange, Oct 8, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Arun Goel
    Replies:
    0
    Views:
    1,002
    Arun Goel
    Nov 12, 2003
  2. JP Martin

    RMI without the rmiregistry

    JP Martin, Oct 5, 2004, in forum: Java
    Replies:
    1
    Views:
    3,168
    Esmond Pitt
    Oct 6, 2004
  3. silarri

    Monitoring the rmiregistry

    silarri, Jan 3, 2005, in forum: Java
    Replies:
    3
    Views:
    1,629
    silarri
    Jan 4, 2005
  4. jonck

    rmiregistry woes

    jonck, Jan 21, 2005, in forum: Java
    Replies:
    6
    Views:
    611
    Esmond Pitt
    Jan 24, 2005
  5. David Kensche

    Help! with RMIRegistry

    David Kensche, Mar 11, 2005, in forum: Java
    Replies:
    0
    Views:
    731
    David Kensche
    Mar 11, 2005
Loading...

Share This Page