Tuesday, July 24, 2007

How to start RMIRegistry programmatically

I often face with the necessity of programmatical RMI registry starting. So, this is a solving:

try {
    java.rmi.registry.LocateRegistry.createRegistry(1099);
    System.out.println("RMI registry ready.");
} catch (Exception e) {
    System.out.println("Exception starting RMI registry:");
    e.printStackTrace();
}

2 comments:

Akinwale Ifaniyi said...
This comment has been removed by the author.
Akinwale Ifaniyi said...

Glad I found this when I did... Saved me hours of debugging. Thanks.