aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes jarring submission Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "jarring submission" Watch "jarring submission" New topic
Author

jarring submission

Alex Gregory
Ranch Hand

Joined: Jun 15, 2002
Posts: 46
Hi ranchers, can someone do me a huge favor? I spent over 10 hours on this, and with no progress. I want to jar up my assignment and already read how to do it, can someone please tell me a step-by step list of what to do.
I have the following directory structure right now.
c:\scjd\starting\suncertify\db
c:\scjd\starting\suncertify\client
c:\scjd\starting\suncetify\server
My db.db and policy file are in \starting.
I tried to create an executable Jar but with no luck, the output was something like class not found, and i even included all the classpathss.
so I hope someone could help me out. Thanks so much in advance.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

Here is a batch file that I had that made my two executable jar files for me.
Notice that there is a manifest.mf file. This file tells the jar what class has the main method.

Here's my server manifest file

And for those jsut curious, here is my batch file to make the Javadocs


Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Robin Underwood
Ranch Hand

Joined: May 01, 2002
Posts: 117

Also this may just be a problem with Windows (or something weird that I did), but I needed a carriage return after the last line before the jar command recognized the "main-class" statement.
[ July 02, 2002: Message edited by: Robin Underwood ]
Alex Gregory
Ranch Hand

Joined: Jun 15, 2002
Posts: 46
Thanks Mark, but I get the following error:
Exception in thread "main" java.lang.NoClassDefFoundError suncertify/client/ClientFrame
My manifest file was just 1 line:
Main-Class: suncertify.client.ClientFrame
I run java -cp c:\scjd\starting -jar client.jar Local inside the c:\scjd\starting directory.
I hope someone could see why this is occuring. thanks again
Alex Gregory
Ranch Hand

Joined: Jun 15, 2002
Posts: 46
Mark, thanks very much, I figured out the local client jar. Now, the problem is i am trying to set the rmi.server.codebase, but my stubs and skeletons are inside suncertify\server, which is inside server.jar, so my question is can i set the codebase = to the jar file?
Alex Gregory
Ranch Hand

Joined: Jun 15, 2002
Posts: 46
Hi, when i try to run the server from c:\testing with the following line i get marshalling exceptions, and i placed my stubs and skeletons into server.jar which has all the other server files. I am going nutz here, can I anyone see what im doing wrong?
java -Djava.security.policy=test.policy
-D java.rmi.codebase=c:\testing/server.jar -jar server.jar %1 %2
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

Put the stubs into the client jar too.
Mark
Sai Prasad
Ranch Hand

Joined: Feb 25, 2002
Posts: 560
Alex,
The problem is not with the server but with the RMI registry. The RMI Registry is unable to locate the _Stub.class files.
Alex Gregory
Ranch Hand

Joined: Jun 15, 2002
Posts: 46
Sai, how can I make the RMI registry locate the stub files? And Mark, I havent even ran the client yet, do you think not putting the stubs in the client would cause the server to fail? Before this jarring business everything worked with the skel and stub only located in the server. Thanks, and please continue to help.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jarring submission