Help! with RMIRegistry

Discussion in 'Java' started by David Kensche, Mar 11, 2005.

  1. Hello,
    I desperately need help with the RMIRegistry.
    I run an application which makes use of this
    registry (JADE agent development platform).
    I tried this on two systems one of which works
    fine. The other one always made problems if
    JADE was not properly closed. In this case
    Jade could not deregister with the registry.
    For the case when this happened I wrote a little
    application which erases the registry:

    public class RMIC {
    private static final String LOG_CONF_DIR =
    System.getProperty("user.dir");
    private static final String LOG_CONF_FILE = "log4j.properties";
    private static Logger logger = Logger.getLogger(RMIC.class);

    public static void main(String[] args) {
    // Configure log4j.
    PropertyConfigurator.configure(LOG_CONF_DIR+
    System.getProperty("file.separator")+
    LOG_CONF_FILE);
    if(System.getSecurityManager() == null)
    System.setSecurityManager(new RMISecurityManager());
    logger.debug("SecurityManager set.");
    String rmiURL = "rmi://localhost";
    String[] names = null;
    try {
    names = Naming.list(rmiURL);
    } catch(MalformedURLException e) {
    logger.fatal("Malformed URL:" + rmiURL, e);
    } catch(RemoteException e) {
    logger.fatal("Error in lower layers.", e);
    }
    for(String name : names) {
    System.out.println("Degistering name:" + name);
    try {
    Naming.unbind(name);
    } catch(MalformedURLException e) {
    logger.fatal("Malformed URL:" + rmiURL, e);
    } catch(RemoteException e) {
    logger.fatal("Error in lower layers.", e);
    } catch(NotBoundException e) {
    logger.fatal("Name not bound:" + name, e);
    }
    }
    }
    }

    This solved my problem for some days. But now
    the RMIRegistry seems to not be available anymore
    and I don't know much about it. The following exception
    is thrown:

    java.rmi.NoSuchObjectException: no such object in table
    at
    sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknow
    n Source)
    at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
    at sun.rmi.server.UnicastRef.invoke(Unknown Source)
    at sun.rmi.registry.RegistryImpl_Stub.list(Unknown Source)
    at java.rmi.Naming.list(Unknown Source)
    at org.rwth.i5.rmic.RMIC.main(RMIC.java:28)
    Exception in thread "main" java.lang.NullPointerException
    at org.rwth.i5.rmic.RMIC.main(RMIC.java:34)

    BTW I have to JDK 1.4 and 1.5 installed. May this cause
    the problem?

    Please can anybody help?

    Thanks beforehand,
    David
    David Kensche, Mar 11, 2005
    #1
    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. Rob Dempster

    RMI with rmiregistry on remote host

    Rob Dempster, Oct 8, 2003, in forum: Java
    Replies:
    1
    Views:
    2,677
    Marek Lange
    Oct 8, 2003
  2. Arun Goel
    Replies:
    0
    Views:
    922
    Arun Goel
    Nov 12, 2003
  3. JP Martin

    RMI without the rmiregistry

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

    Monitoring the rmiregistry

    silarri, Jan 3, 2005, in forum: Java
    Replies:
    3
    Views:
    1,499
    silarri
    Jan 4, 2005
  5. Replies:
    0
    Views:
    815
Loading...

Share This Page