use of yyl.example.basic.rmi.api.HelloService in project yyl_example by Relucent.
the class HelloClient method main.
public static void main(String[] args) {
try {
// 在RMI服务注册表中查找名称为RHello的对象,并调用其上的方法
HelloService service = (HelloService) Naming.lookup("rmi://localhost:8888/hello");
System.out.println(service.hello());
System.out.println(service.hello("I'm the king of the world!"));
} catch (NotBoundException e) {
e.printStackTrace();
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (RemoteException e) {
e.printStackTrace();
}
}
Aggregations