用 ./shutdown.sh 关闭 rmi 服务器的 tomcat ,然后 ./startup.sh 启动,客户端连接总是会导致错误
用 ./shutdown.sh 关闭 rmi 服务器的 tomcat ,然后 ./startup.sh 启动,客户端连接总是会导致如下错误:
org.springframework.remoting.RemoteLookupFailureException: Lookup of RMI stub failed; nested exception is java.rmi.UnmarshalException: error unmarshalling return; nested exception is: java.io.EOFException
com.ffcs.ieie.communicate.ieiemp.IeiempException: org.springframework.remoting.RemoteLookupFailureException: Lookup of RMI stub failed; nested exception is java.rmi.UnmarshalException: error unmarshalling return; nested exception is: java.io.EOFException
Tomcat作为服务器端,另外一台主机上作为客户端,当服务器多次重启后,客户端远程调用连接不上,在windows上没有出现这样的问题,请高手赐教!
服务器的代码为:try{
LocateRegistry.createRegistry(1099);
}catch(Exception e){
e.printStackTrace();
}
try{
// System.out.println(remoteName);
Naming.rebind(remoteName, (RemoteDataRefresh)this);
System.out.println("registry!!");
}catch(Exception e){
e.printStackTrace();
}
客户端代码为:try{
LocateRegistry.createRegistry(1099); //3
}catch(Exception e){
e.printStackTrace();
}
//new a service
createNewService();
/*comment following codes may lead to bug?*/
//for (int i = 0; i < ALPHABET.length(); i++) {
// dirs[i].close();
//}
//refresh remote retrievaler
try{
if (rdr==null)
rdr = (RemoteDataRefresh)Naming.lookup(rdrName);
rdr.reopenSearcher(serviceNo);
}catch(Exception e){
e.printStackTrace();
}