• Post Reply Bookmark Topic Watch Topic
  • New Topic

JINI-Client  RSS feed

 
Saskia Schreiber
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there, I hope someone of you is familiar with JINI. I set up rmid, webserver with codebase etc. and my Server is running fine. I've just one problem with my client. When I'm starting the client from my computer, He get's the code and does everything fine. When I'm starting the client from another computer it finds (the client prints out the SID of the service) the service but doesn't call the method in the service and runs on and on. So what is wrong with my client?
Here's my client-code:
import fs_jini.client_server.ConvertService;
public class ConvertClient {
public ConvertClient() {
}
public static void main(String[] args) throws Exception{
ServiceFinder sf = new ServiceFinder(ConvertService.class);
ConvertService c = (ConvertService)sf.getObject();
System.out.println(c.convert(5,12));
}
}
and my server-code:
import fs_jini.client_server.ConvertService;
import java.io.*;
import java.rmi.*;
import java.rmi.server.*;
import net.jini.discovery.*;
public class ConvertServiceImpl extends UnicastRemoteObject implements ConvertService {
public ConvertServiceImpl() throws RemoteException {
}
public String convert(int a,int b) throws RemoteException {
System.out.println("Jetzt wurde ich aufgerufen");
return String.valueOf(a+b);
}
public static void main(String[] args) throws Exception{
System.setSecurityManager(new RMISecurityManager());
String[] goups = new String[] {""};
LookupDiscovery reg = new LookupDiscovery(goups);
ConvertService csi = (ConvertService)new ConvertServiceImpl();
ServiceListener sl = new ServiceListener(csi);
reg.addDiscoveryListener(sl);
}
}
Would be great if anyone could help me.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!