Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Help! with RMIRegistry

Reply
Thread Tools

Help! with RMIRegistry

 
 
David Kensche
Guest
Posts: n/a
 
      03-11-2005
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
rmiregistry woes jonck Java 6 01-24-2005 12:37 AM
Monitoring the rmiregistry silarri Java 3 01-04-2005 12:51 PM
RMI without the rmiregistry JP Martin Java 1 10-06-2004 07:33 AM
Running Rmiregistry as service, problem on logofff. Arun Goel Java 0 11-12-2003 06:41 PM
RMI with rmiregistry on remote host Rob Dempster Java 1 10-08-2003 04:18 PM



Advertisments