Go Back   Velocity Reviews > Newsgroups > Java
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

Java - Help! with RMIRegistry

 
Thread Tools Search this Thread
Old 03-11-2005, 09:20 AM   #1
Default Help! with RMIRegistry


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.exceptionReceiv edFromServer(Unknow
n Source)
at sun.rmi.transport.StreamRemoteCall.executeCall(Unk nown 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:2
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
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump