java RMI问题!!!能解决问题可以加分啊!!

两个问题
1.使用RMI在aix服务器端发布一个方法,java这边调用aix服务器端暴露出来的方法时,需要登录吗?
2.如果不需要登录,该如何调用,我本地用两台window机器,一台做服务器,一台就客户端是可以访问的。不知道为什么到aix上就不行了。。
贴一下错误信息,求大神帮忙啊!!!
错误信息:Error:java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
java.net.SocketTimeoutException: Read timed out
我贴一下服务器端和客户端的代码
服务器端:
public class AgentServer {

public static void main(String[] args) {

try {
//注册服务
LocateRegistry.createRegistry(1099);
//暴露为一个接口
AgentInterface agInterface=new AgentInterfactImpl();
//绑定方法
Naming.rebind("agInterface", agInterface);

System.out.println("agInterface Server is Readly!");
} catch (Exception e) {
System.out.println("Server exception:"+e);
}
}
}

客户端:
public static void main(String[] args) {
try {
AgentInterface rmi =(AgentInterface)Naming.lookup("rmi://10.192.30.7:1099/agInterface");

System.out.println(rmi.sayHello("Jono"));

} catch (Exception e) {
System.out.println("Error:"+e);
}
}

接口和方法的实现都没有问题,我在自己本机上测试过!求大手!!

1、不需要登录

2、把你连接RMI服务器时的代码贴出来看看追问

代码已经补充上了,麻烦了!

温馨提示:答案为网友推荐,仅供参考
第1个回答  2013-05-13
没连接上吧
第2个回答  2013-05-13
依据你的错误消息,应该是远端服务没有启用(部署)好,或者你机器不通追问

代码已经补充上了,麻烦了!

相似回答