• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

java.rmi.UnmarshalException: ..ClassNotFoundException:

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
eric karamba
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
wow!!! that's really unbelievable!! it worked ,
thanks man,thankyou
it had really bugged me
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the tip Carl!
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.





 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?)
 
Christian Pazmi�o
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Man everything works just Perfect.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic