Hi,
I'm new with Java RMI. For my interesting, I implemented 3 projects:
- one project contains the interface
- one project implements the server side
- one project implements the client side

This is the only interface that I have:

public interface RoleInterface extends Remote{
public List<Role> listOfRole() throws RemoteException;
}

This is the server:
public class UmsServer implements UmsServerConstants, Serializable{

public static void main(String[] argv){
try{
if(System.getSecurityManager() == null) {
System.setSecurityManager(new SecurityManager());
}

System.out.println( "Server starting phase..." );
Registry registry = LocateRegistry.createRegistry( 5000 );

registry.bind( "Role", new UmsRoleImpl() );
System.out.println( "Server is connected and ready for operations..." );

} catch(Exception e){
System.out.println("Server not connected: " + e );
}
}

and this is the client:

public static void main(String[] argv){
try{
System.out.println("CLIENT RUN...");
RoleInterface role = (RoleInterface)Naming.lookup("//127.0.0.1:5000/Role");
System.out.println( "CLIENT RETRIVED ROLE" );
} catch(Exception e){
System.out.println("Client not connected: " + e );
}
}

I compile with MAVEN, and into the relative jar (for server and for client) I produce the MANIFEST file for to be able to start a jar from command line.

1) into the server target directory I launch start rmiregistry
2) from the same directory I launch java -D.java.security.manager -Djava.security.policy=C:/Users/edancom/Desktop/grant.policy -jar user_management_core_rmi_server-2.0.0.jar
3) I open a new command Prompt (for to simulate a new client) and I launch java -cp user_management_core_rmi_interface-2.0.0.jar -Djava.security.manager -Djava.security.policy=C:/Users/edancom/Desktop/grant.policy -jar user_management_core_rmi_client-2.0.0.jar

On client Prompt i received this exception:

Client not connected: java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
java.lang.ClassNotFoundException: ums.rmi.business_logic.RoleInterface

Why it doesn't find the class, if I see the correct jar and also the MANIFEST file i correctly setted?

My MANIFEST file for the client jar

Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: edancom
Build-Jdk: 1.6.0
Implementation-Title: User Management Core RMI Client
Implementation-Version: 2.0.0
Implementation-Vendor-Id: user_management_core
Main-Class: ums.rmi.server.UmsClient
Class-Path: ./ ./user_management_core_rmi_interface-2.0.0.jar ./databa
se-manager-2.0.0.jar ./mysql-connector-java-5.1.20.jar ./property_man
ager-2.0.0.jar

Thanks in advange

Daniele