Forums Register Login

java.rmi.UnmarshalException: ..ClassNotFoundException:

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
wow!!! that's really unbelievable!! it worked ,
thanks man,thankyou
it had really bugged me
+Pie Number of slices to send: Send
Thanks for the tip Carl!
+Pie Number of slices to send: Send
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.





+Pie Number of slices to send: Send
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?)
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
Thanks Man everything works just Perfect.
The glass is neither half full or half empty. It is too big. But this tiny ad is just right:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 37050 times.
Similar Threads
EJB in WebSphere
rmiregistry will not bind with codebases not on drive c
Setting Codebase in Eclipse
RMI and Name Resolution for multiple drives
problem executing executable jar file
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 19, 2024 04:33:41.