启动RMI注册并注册远程对象时的注意事项:
可以使用如下两种方式
LocateRegistry.createRegistry(51099);
try {
Naming.rebind("//localhost:51099/TalkServer", remote);
} catch (Exception e) {
e.printStackTrace();
}
或
Registry re=LocateRegistry.createRegistry(51099);
try {
re.rebind("TalkServer", remote);
} catch (Exception e) {
e.printStackTrace();
}