Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Jar-Jar Binks and Stubs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Badass: Making Users Awesome this week in the Game Development forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Jar-Jar Binks and Stubs" Watch "Jar-Jar Binks and Stubs" New topic

Jar-Jar Binks and Stubs

Mark Spritzler

Joined: Feb 05, 2001
Posts: 17260

OK, bad pun. Sorry.
I am Jarring up my client and my server. I have included the stub and skeleton files in both jars. I want to be able run them from any directory. I have a batch file, a policy file, and the db.db file to be in the same directory as the jar file. When I run the server, I get a marshalling error, whenever I have it in some other directory from the main directory I built my code from.
Here is an example
I have a c:\devexam directory. In this directory I have the db.db file and some other batch files, mostly for compiling and rmic, and running my client and server.
In subdirectories I have the source/javadoc/and class files in
c:\devexam\suncertify\db and c:\devexam\suncertify\client
In the suncertify.db package is where I have all the server code, including the stub and skeleton of my ConnectionFactory class.
If I jar with the command from the c:\devexam directory
jar -cvf server.jar suncertify\db\*.class
I get my server.jar and it has all the class files.
Now if I run java like
start rmiregistry
java -classpath server.jar;. suncertify.db.ConnectionFactoryEngine
in the c:\devexam directory everything works fine. If I do put the files in c:\devexam\serverfiles It gives me the Marshalling error.
I tried adding the codebase option with the code base pointing to suncertify\db but that didn't work. I don't want to have the codebase point to a static directory. I thought that codebase using a jar file, or the classpath pointing to the jar file would work, but it didn't
Any ideas?

Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17260

Any Suggestions?
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Jar-Jar Binks and Stubs