Here is my directory structure:-
All the client classes have package statement as :-
I can run my client as :-
suncertify.client.FBNClient hostname portnumber
This is what I do to create jar file
Created-By: 1.2.2 (Sun Microsystems Inc.)
I create jar file as:-
<c:\> jar -cvfm client.jar suncertify\client\manifest.mf suncertify\client\*.class
Then I run it as :-
java -jar client.jar hostname portnumber
This gives me a nullpointer exception.
So what am I doing wrong??
normally NullPointerExceptions have nothing to do with the .jar file but with your code. Try to find out where the NullPointerException acutally occurrs.
When something is wrong with the .jar, you usually get exceptions like FileNotFound or Zip...
[ September 05, 2002: Message edited by: Mag Hoehme ]
<c:>jar cvfm client.jar c:\suncertify\client\manifest.mf c:\suncertify\client\*.class
I was getting FileNotFoundException.
SO I changed c:\suncertify to suncertify\. But this started giving NullPOinterr...
But at the same time when I run the same using the class name directly it works. Why it does not gives me a Null Pointer exception there?
Right now I am building jar file using all the client/server/db classes. What is the better way to distribute the files.
This is what I tried keeping db common in both client and server. But then the client complains about the stub file. I know there is a way to resolve the problem of stub file. I guess RMI allows the client to download the stub files from the server . I just dont remember how to do this.
Originally posted by Michael Morris:
That's what I did. Simple and no headaches or worrying if a stub is going to properly load.
How many jar files did u created. I mean if you are keeping all the directories in one jar file then you don't need multiple jar files. Did u created one for server and one for client?
... I mean if you are keeping all the directories in one jar file then you don't need multiple jar files.
Yes, but you can only have one main class per executable jar file. So you really need two jars: 1 client and 1 server.
Did u created one for server and one for client?
I had one for the client and one for the server. They were both placed in the submission jar.