views:

47

answers:

0

Hi Guys.

Have a question related to how RMI loads the interface classes.

So here is my set up:

An interface that defines the operation that the rmi server performs.

Common

public interface Computable<T> extends Remote{
    public AnalyticalServiceOutput<T> compute(Request request) throws RemoteException;
}

Server

Computable<Map<String, String>> stub = (Computable) UnicastRemoteObject.exportObject(this, 0);
Registry registry = LocateRegistry.createRegistry(2000);
registry.rebind("myservice", stub);

Client

Registry registry = LocateRegistry.getRegistry(host, port);
Computable c = (Computable) registry.lookup("myservice");
AnalyticalServiceOutput<Map<String, String>> output = c.compute(request);

For deployment, I put the common jar in the classpath for client as well as server.

When I ran the client and server on eclipse, it worked perfectly fine. Feeling triumphant, I moved both the client and the server to a linux box. But now, when I make a call to compute(request), the client complains (ClassNotFoundException) that one of the classes defined in the common is not available.

Any ideas as to what is going on.

Cheers