• 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
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
  • paul wheaton
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Rob Spoor
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:

jarring submission

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Put the stubs into the client jar too.
Mark
 
Ranch Hand
Posts: 560
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Live ordinary life in an extraordinary way. Details embedded in this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic