J
Jayaram
I have a server program that registers two remote objects with the
rmiregistry. The Server code is as follows:
********************************************************************************
import java.rmi.Naming;
public class Server {
public Server() {
try{
Service1 s1 = new StoreService();
Naming.rebind("//172.25.14.65:1099/StoreService",s1);
Service2 s2 = new RetrieveService();
Naming.rebind("//172.25.14.65:1099/RetrieveService",s2);
System.out.println("Registered Services with the registry");
}catch(Exception e) {
System.out.println("Exception in Server initialization "+e);
e.printStackTrace();
}
}
public static void main(String[] args) {
new Server();
}
}
********************************************************************************
I have a Client program that performs a lookup on the registry:
public class Client{
public static void main(String[] args) {
try{
String slist[] = Naming.list("//172.25.14.65:1099");
int length = slist.length;
for(int i=0;i<length;i++) {
System.out.println("Registry contains - "+slist[0]);
}
}catch(Exception e) {
System.out.println("Exception in Client "+e);
e.printStackTrace();
}
}
}
Ideally the client should have seen entries for both the remote
objects. But the client consistently prints:
Registry contains - //172.25.14.65:1099/StoreService
Registry contains - //172.25.14.65:1099/StoreService
Why dont I see the entry:
Registry contains - //172.25.14.65:1099/RetrieveService ?
Regards,
Jayaram
rmiregistry. The Server code is as follows:
********************************************************************************
import java.rmi.Naming;
public class Server {
public Server() {
try{
Service1 s1 = new StoreService();
Naming.rebind("//172.25.14.65:1099/StoreService",s1);
Service2 s2 = new RetrieveService();
Naming.rebind("//172.25.14.65:1099/RetrieveService",s2);
System.out.println("Registered Services with the registry");
}catch(Exception e) {
System.out.println("Exception in Server initialization "+e);
e.printStackTrace();
}
}
public static void main(String[] args) {
new Server();
}
}
********************************************************************************
I have a Client program that performs a lookup on the registry:
public class Client{
public static void main(String[] args) {
try{
String slist[] = Naming.list("//172.25.14.65:1099");
int length = slist.length;
for(int i=0;i<length;i++) {
System.out.println("Registry contains - "+slist[0]);
}
}catch(Exception e) {
System.out.println("Exception in Client "+e);
e.printStackTrace();
}
}
}
Ideally the client should have seen entries for both the remote
objects. But the client consistently prints:
Registry contains - //172.25.14.65:1099/StoreService
Registry contains - //172.25.14.65:1099/StoreService
Why dont I see the entry:
Registry contains - //172.25.14.65:1099/RetrieveService ?
Regards,
Jayaram