TopoAPI topoApi = (TopoAPI) java.rmi.Naming.lookup("//serverIP/TopoAPI");
中应该指明协议类型和IP吧!
Product c1 = (Product)Naming.lookup("rmi://192.168.1.1/toaster");
中应该指明协议类型和IP吧!
Product c1 = (Product)Naming.lookup("rmi://192.168.1.1/toaster");
可以得到那个TopoAPI,
但是在调用topoApi.addObject(MO);
就出错了,有没有大侠知道呀
Class LocateRegistry
java.lang.Object
|
+--java.rmi.registry.LocateRegistrycreateRegistry(int port)
Creates and exports a Registry on the local host that accepts requests on the specified port.在你的服务端加上LocateRegistry.createRegistry(1099);然后启动服务器,再连接看一下。