D
David Kensche
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
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