wood burning stoves 2.0*
The moose likes Distributed Java and the fly likes java.rmi.UnmarshalException: ..ClassNotFoundException: Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "java.rmi.UnmarshalException: ..ClassNotFoundException:" Watch "java.rmi.UnmarshalException: ..ClassNotFoundException:" New topic
Author

java.rmi.UnmarshalException: ..ClassNotFoundException:

eric karamba
Greenhorn

Joined: Jan 05, 2005
Posts: 2
hi ,
i have the following exception:
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: useful.network.bootstrap.RMIServerBootstrap_Stub
at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:385)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:240)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
..........


ok i've really struggled to solve this but nothing seems to work..
i have both the server and the client on the same machine( am using mandrake linux and java 1.5.0)

i launched the rmiregistry on a different shell after setting classpath to null i.e:export CLASSPATH=""
i then compiled everything using : javac -classpath . <filename.java>
i then run rmic ,then did
java -Djava.rmi.server.codebase=file:///eric/dess/system/sysd/useful/network/bootstr ap/ -Djava.security.policy=permission test

but got the above error..
i think its the rmiregistry which can't locate the stub class file which is found here, /home/eric/dess/system/sysd/useful/network/bootstrap/RMIServerBootstrap_Stub.cl ***,

yet i'm convinced that the classpath is well set (at first i din't think i needed to set the codebase since all my files are on the same machine ) and so is the codebase variable,

pliz if someone could help ,i just dont have any more ideas ,thanks in advance
Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
Remeber, Java paths are to the top of the pacakage. Change the codebase to
java -Djava.rmi.server.codebase=file:///eric/dess/system/sysd -Djava.security.policy=permission test
Try it again.


I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
eric karamba
Greenhorn

Joined: Jan 05, 2005
Posts: 2
wow!!! that's really unbelievable!! it worked ,
thanks man,thankyou
it had really bugged me
Madison Moose
Greenhorn

Joined: Jul 03, 2004
Posts: 16
Thanks for the tip Carl!


SCJP
Christian Pazmi�o
Greenhorn

Joined: Jun 07, 2004
Posts: 6
Hi, I'm working with J2EE 1.5 about 2 days I? following Java Bible. But I have a problem.

I have 3 files in order to study rmi.
FlightServer
StartFlightServer
FlightServerImpl
FlightClient

Every file is compiled with javac. the FlightServerImpl_stub is also ready.
But when I try to java StartFlightServer I got a Horrible error.

java pack.StartFlightServer
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: pack.FlightServerImpl_Stub
at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:385)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:240)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
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:595)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)

I also try changing the CLASSPATH but nothing works. I supose that it si not finding the _stub class. But i do not what it is going on.

Please I need some help I'm using White Box Linux 3. JDK 1.5.

I compiled the java files with:

javac -cp /mnt/Flaka/Java.Bible/Chapter4/Linux_try/ StartFlightServer.java

Please I really need some help.
Sorry but I'm newbie.

PD: Sorry about my English but my native language is the Spanish. =)

nait.





Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Sorry, but since you didn't mention these things in your post -

Have you run rmic on your FlightServerImpl class to produce stubs?

Are you setting the -Djava.rmi.server.codebase property when you run (like in Carl Trusiak's post above)?

(Also, why did you post this at the end of an existing thread? Why not just start a new thread?)


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Christian Pazmi�o
Greenhorn

Joined: Jun 07, 2004
Posts: 6
I Already run rmic over FlightServerImpl and It produce me the stubs.
My problem It is that in order to execute the app. I have to execute the StartFlightServer to bind the fightServerImpl class under the name FlightService to registry that runs on the same machine as the server (localhost) on port 6001

here is the source.

package pack;

import java.rmi.*;
import java.rmi.registry.LocateRegistry;

public class StartFlightServer {

public static void main (String args[]) {
try {
FlightServerImpl fsi = new FlightServerImpl();
Naming.rebind("rmi://localhost:6001/FlightService",fsi);
System.out.println("FlightService is waiting for the requests on port 6001...");
} catch(Exception ex) {
ex.printStackTrace();
}
}
}

I'm emulate 3 diferent machines.
1.- #rmiregistry 6001
2.- #java StartFLightServer
Should give something like this: FlightServer is waiting for the request on port 6001
3.-#java -Djava.security.policy=security.policy FlightClient CO1208
Arrival Time of CO1208 is 3:20PM

The error That I was alking about give on machine 2 when I try to execute StartFLightServer.

I hope this help you to help me.
And Why didn't I begin a new Thread?? I really don't know.
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

It sounds like you need to add the -Djava.rmi.server.codebase property to the command line for 2(your server). This property tells remote clients where to look for classes needed by the server that may not be in the clients classpath. The reason that you are getting this error when running the server is because the server has to register with rmiregistry, and rmiregistry is a remote client to your server, and it can't find the stub class it needs to get a reference to.

There's an example of what's needed for this up in the second post in this thread, the one by Carl Trusiak.
Christian Pazmi�o
Greenhorn

Joined: Jun 07, 2004
Posts: 6
Thanks Man everything works just Perfect.
 
Consider Paul's rocket mass heater.
 
subject: java.rmi.UnmarshalException: ..ClassNotFoundException:
 
Similar Threads
Setting Codebase in Eclipse
EJB in WebSphere
RMI and Name Resolution for multiple drives
rmiregistry will not bind with codebases not on drive c
problem executing executable jar file