RMI.....Testing further

Hello,

I posted I am trying to test RMI for further use in another project of mine but i am having trouble with the connection and security issues.

Firstly my Client-Server test worked perfectly when they shared a package. Now ,however, i have moved them both into separate "project" files in eclipse to try and check if they could work in a real environment. It Began by giving me connection issues, which i solved, and then security issues, which i seem to have solved, but now i get told it cant find my interfaces which are used by my client to interpret the information sent by the server.

Please i would really appreciate some help and will post my code, policy files and the batch code used to start the program.

Furthermore in my actual RMI project, which this is a test for, i have RMI server-side methods which return objects which i have created. How does a code base work in such a situation, i am having some trouble understanding them?

//Server Class-

public class Server {

public Server(String serverName){

try {

Speaker speaker=new Speaker();

Registry registry = LocateRegistry.createRegistry(Registry.REGISTRY_PORT);

//Registry registry = LocateRegistry.getRegistry();

registry.rebind(serverName, speaker);

System.out.println("Server Started!");

} catch (Exception e) {

e.printStackTrace();

}

}

public static void main(String[] args){

new Server("SudokuServer");

}

}

//-Client Class--

private static final String SERVER="localhost";

public Client(String getServer){

try {

System.setSecurityManager(new RMISecurityManager());

Registry registry = LocateRegistry.getRegistry(SERVER);

ServerInterface remoteObject = (ServerInterface) registry.lookup("SudokuServer");

System.out.println(remoteObject.say("I am God"));

} catch (Exception e) {

e.printStackTrace();

}

}

//-Batch Code-

java -Djava.security.policy=MrPolicy.policy Client

//-Policy File Used

grant {

permission java.net.SocketPermission "*:1024-65535","connect,accept,listen,resolve";

permission java.security.AllPermission;

};

Please could someone help me out, and please i' m a bit of a novice so could you please be as accommodating in your language as passable.

Thanks Alot

[2415 byte] By [NoRationalSolutiona] at [2007-11-27 11:17:36]
# 1

The remote interface has to be the same at client and server. Not a similar class in different packages.

ejpa at 2007-7-29 14:25:55 > top of Java-index,Core,Core APIs...