Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

RMI: java.rmi.UnmarshalException: error unmarshalling arguments

34 views
Skip to first unread message

Karl Voit

unread,
Aug 16, 2001, 10:04:14 AM8/16/01
to
... because the server can't find/unmarshall the client-class:

ComputePi exception: RemoteException occurred in server thread;
nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments;
nested exception is:
java.lang.ClassNotFoundException: client.Pi


Do I really have to store _every_ potential classfile to be executed on the
client _and_ the server??? I want RMI to "transport" the *.class over the
net by itself!


The whole story:
----------------

I tried to run the RMI-tutorial example from
http://java.sun.com/docs/books/tutorial/rmi/

But I did the whole thing using the stand-alone httpd class-server.

When I run the thing one one machine but different users for client and
server, I get the right result with the files avaliable shown at the end of
this posting:

vk@lisa:~/RMI_tutorial$ ./startclient.sh
CLASSPATH set to: RMI_tut + compute.jar
starting Client: (client.ComputePi)
Start the thing ...
after String
Naming done
Pi done
3.14159265358979323846
end.
vk@lisa:~/RMI_tutorial$

Fine.

But I wondered, why do I need a httpd, when all class-files have to be
avaliable on the server _and_ on the clients?

I need a system, where the class-file is transported over the network to a
server, which executes the demanded method and returns the result ...

So I deleted the Pi.class from the server and then I got this:

vk@lisa:~/RMI_tutorial$ ./startclient.sh
CLASSPATH set to: RMI_tut + compute.jar
starting Client: (client.ComputePi)
Start the thing ...
after String
Naming done
Pi done
ComputePi exception: RemoteException occurred in server thread; nested
exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested
exception is:
java.lang.ClassNotFoundException: client.Pi
java.rmi.ServerException: RemoteException occurred in server thread; nested
exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested
exception is:
java.lang.ClassNotFoundException: client.Pi
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception
is:
java.lang.ClassNotFoundException: client.Pi
java.lang.ClassNotFoundException: client.Pi
at
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:245)
at
sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:220)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
at engine.ComputeEngine_Stub.executeTask(Unknown Source)
at client.ComputePi.main(ComputePi.java:20)
end.
vk@lisa:~/RMI_tutorial$


Server:
=======

drwxr-xr-x 2 ralf users 4096 Aug 16 14:01 ClassServer
drwxr-xr-x 2 ralf users 4096 Aug 16 14:04 client
drwxr-xr-x 2 ralf users 4096 Aug 16 14:03 compute
drwxr-xr-x 2 ralf users 4096 Aug 16 14:02 engine
-rwxr-xr-x 1 ralf users 156 Aug 14 15:41 java.policy
-rwxr-xr-x 1 ralf users 60 Aug 14 16:51 killserver.sh
-rwxr-xr-x 1 ralf users 839 Aug 14 18:02 startserver.sh

./ClassServer:
-rw-r--r-- 1 ralf users 1823 Aug 13 16:14 ClassFileServer.class
-rw-r--r-- 1 ralf users 2817 Aug 13 16:14 ClassServer.class

./client:
-rw-r--r-- 1 ralf users 1295 Aug 13 16:21 Pi.class
---> this last line I don't want to have on the server!!!

./compute:
-rw-r--r-- 1 ralf users 238 Aug 13 13:34 Compute.class
-rw-r--r-- 1 ralf users 166 Aug 13 13:35 Task.class

./engine:
-rw-r--r-- 1 ralf users 1541 Aug 14 18:01 ComputeEngine.class
-rw-r--r-- 1 ralf users 3284 Aug 14 18:01 ComputeEngine_Stub.class


Client:
=======

drwxr-xr-x 2 vk users 4096 Aug 16 14:03 client
-rw-r--r-- 1 vk users 916 Aug 13 13:36 compute.jar
drwxr-xr-x 2 vk users 4096 Aug 16 14:04 engine
-rwxr-xr-x 1 vk users 156 Aug 14 15:39 java.policy
-rwxr-xr-x 1 vk users 405 Aug 16 14:00 startclient.sh

./client:
-rw-r--r-- 1 vk users 1483 Aug 14 17:29 ComputePi.class
-rw-r--r-- 1 vk users 1295 Aug 13 16:21 Pi.class

./engine:
-rw-r--r-- 1 vk users 3284 Aug 14 18:01 ComputeEngine_Stub.clas


--
Karl VOIT, Graz University of Technology (Austria/Europe)
begin I_am_a_Signature_-_not_a_Virus.jpg.txt
http://www.dagegen.org/LOVE-LETTER.txt.html
end

0 new messages