• Post Reply Bookmark Topic Watch Topic
  • New Topic

Can't find stubs  RSS feed

 
Bryan Clauser
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I created a class that extends UnicastRemoteObject in a package called
package suncertify.db;
the file is located in the dir
/sun/suncertify/db/
I generate the stubs with the command:
rmic -classpath /sun/ -keep -d /sun/ suncertify.db.DataServer
The stub files show up in the /sun/suncertify/db
inside the DataServer class the constructor does the following:

I then set my PATH
export PATH=$PATH:/sun/
and run the following:
java -classpath /sun/ -Djava.security.policy="//sun/suncertify/db/policy" suncertify.db.DataServer
which returns me a
DataServer exception: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: suncertify.db.DataServer_Stub

Any ideas?

[ March 24, 2002: Message edited by: Bryan Clauser ]
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have rmiregistry running?
 
Bryan Clauser
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Michael,
Thanks for the quick reply. I did have the rmiregirstry running, the problem I ran into was setting the codebase.
running the following command worked:
D:\sun\suncertify\db>java -classpath d:\sun\ -Djava.rmi.server.codebase=file:///d:\sun\ -Djava.security.policy="d:\sun\suncertify\db\policy" suncertify.db.DataServer
don't pay attention to the OS changes, I bounce form NT at work to Linux at home, but the codebase was the problem.
Thanks again
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cool - I thought I'd walk through one potential problem at a time rather than dump a laundry list. Glad you found it.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've set classpath to nothing and started the registry in another session. Used to get the exact same unmarshaling error for stubs until I got the codebase setting right.
So it works now and my server successfully binds to the registry, but...
I've seen posts that talk about no codebase setting at all. How do these setups work if there is no codebase?
I'm concerned about specifying a machine-specific codebase setting. "w:/certification/scjd" will not be on the evaluator's machine. Is it OK to have the evaluator specify the codebase?
 
Bryan Clauser
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, as long as you documented it, I ended up telling the grader to run the program from the base directory and everything was fine.
 
Kumar Kausikasa
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Eric,
If there is no codebase it will see the classpath and if it can find stub classes there ( i mean it will search the whole classpath specified and if it can find in the specified classpath) then it won't complain.
HTH
Praveen.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!