wood burning stoves 2.0*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Help please exception when running from command line not in eclipse 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 "Help please exception when running from command line not in eclipse" Watch "Help please exception when running from command line not in eclipse" New topic
Author

Help please exception when running from command line not in eclipse

Ricardo Estafan
Ranch Hand

Joined: Mar 29, 2004
Posts: 84
Hello all,

if i run my application in eclipse all works well. If i ecport the file as a jar file runme.jar and run the application from the command line i receive the following exception :



I will show a snippet of the code :


How on earth can it be possible that it all runs in eclipse and not when i run it from the command line using the jar file...

Now i cannot debug because the problem is not occuring in eclipse environment.

What can i do best in this case?
Please help me out
[ January 29, 2005: Message edited by: Ricardo Estafan ]
Robert Konigsberg
Ranch Hand

Joined: Jun 23, 2004
Posts: 172
1. Which line in your snippet is line 153?
2. Which variable is null? If you can't step through with a debugger, you can always use lots of 'if (blah == null)' everywhere, including stuff like 'if (clientGUI.getCustomerText() == null)'.
3. Finally, were you loading any additional classes or source files in your application?

That's a start.


SCJP 1.4 (91%)<br />SCJD 1.4 (376/400, 94%)
Steven Bell
Ranch Hand

Joined: Dec 29, 2004
Posts: 1071
Usually if something runs in eclipse, but not on the command line, it is a classpath issue. The program can't find some needed file or jar. Although with a NullPointerException that may not be right unless you are getting an object from some factory.
Ricardo Estafan
Ranch Hand

Joined: Mar 29, 2004
Posts: 84
Yes i am getting the database from a factory...

What could i do to test this?
Ricardo Estafan
Ranch Hand

Joined: Mar 29, 2004
Posts: 84
Yo guys i found it the listselectiomodel was null.

But how on earth it didn't fire in eclipse... i don't know???
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Help please exception when running from command line not in eclipse