SnowCrash89
asked on
RMI Unmarshall Exception
Hi,
I am creating a java program which implements an interface to export functions over RMI. All my classes have been defined to be in the package jblog, including the interface class.
Unfortunately I am getting an exception (which I am catching) when running the program.
I am using the following commands:
The exception seems to suggest that the BlogServerInterface class cannot be found, however this class file is in the same directory as the BlogServer class.
Here is the code for BlogServer and I have pointed out where the exception is being thrown:
Any help much appreciated, thanks.
I am creating a java program which implements an interface to export functions over RMI. All my classes have been defined to be in the package jblog, including the interface class.
Unfortunately I am getting an exception (which I am catching) when running the program.
I am using the following commands:
#rmiregistry &
#java -classpath . jblog/BlogServer
*** Server exception: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: jblog.BlogServerInterface
The exception seems to suggest that the BlogServerInterface class cannot be found, however this class file is in the same directory as the BlogServer class.
Here is the code for BlogServer and I have pointed out where the exception is being thrown:
try
{
//create an object of current class and get stub
BlogServer obj = new BlogServer();
BlogServerInterface stub = (BlogServerInterface) UnicastRemoteObject.exportObject(obj, 0);
// Bind the remote object's stub in the registry
Registry registry = LocateRegistry.getRegistry();
registry.rebind("BlogServerInterface", stub); // EXCEPTION THROWN HERE
//server ready, now waiting for calls
printToConsole("Server ready for remote calls");
} catch (Exception e)
{
printToConsole("Server exception: " + e.toString());
}
Any help much appreciated, thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
correction: *so no package is specified
ASKER