Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Can't find stubs

 
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 ]
 
High Plains Drifter
Posts: 7289
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
Posts: 7289
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.
 
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.
 
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.
 
Creativity is allowing yourself to make mistakes; art is knowing which ones to keep. Keep this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic