After Joseph Dane sung RMI's praises, I decided to go back and recode
my little app, and I must admit it was easier.
At least until I tried to test it. I'm running this method:
public static void main(String[] args) {
try {
System.out.println("I'm starting now...");
Server s = new ServerImplementation();
Naming.rebind("albert", s);
System.out.println("Albert Server ready.");
} catch (RemoteException e) {
e.printStackTrace();
} catch (MalformedURLException e) {
e.printStackTrace();
}
}
which is in a StartServer class in the same package as
ServerImplementation (org.dupontmanual.albert.server). It creates the
ServerImplementation object, but has problems with the binding:
java.rmi.ServerException: RemoteException occurred in server thread;
nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments;
nested exception is:
java.lang.ClassNotFoundException:
org.dupontmanual.albert.server.ServerImplementation_Stub
at sun.rmi.server.UnicastServerRef.oldDispatch
(UnicastServerRef.java:352)
at sun.rmi.server.UnicastServerRef.dispatch
(UnicastServerRef.java:207)
at sun.rmi.transport.Transport$1.run(Transport.java:148)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
at sun.rmi.transport.tcp.TCPTransport.handleMessages
(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run
(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:552)
at
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer
(StreamRemoteCall.java:247)
at sun.rmi.transport.StreamRemoteCall.executeCall
(StreamRemoteCall.java:223)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:350)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Naming.java:160)
at org.dupontmanual.albert.server.StartServer.main
(StartServer.java:14)
The weird thing is that ServerImplementation_Stub.class is right
there inside the same folder as StartServer.class and
ServerImplementation.class, so I can't understand why the ClassLoader
can find them and not it. I have this problem both when I run from
inside Eclipse using the RMI Plugin, but also when I run from the
command line.
Any ideas?
Todd
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden