By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,742 Members | 773 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,742 IT Pros & Developers. It's quick & easy.

Integration problem - Null pointer Exception

P: 50
Hi...

When my project is executed as individual files it is executed perfectly. But when its executed as a whole project it throws Null Pointer Exception.

How could this be rectified and what will be the problem.

I accessed the value using variable and tried using getter methods too and still throws the same error.

Thank you.
Apr 6 '09 #1
Share this Question
Share on Google+
5 Replies


Expert 10K+
P: 11,448
Are you using file resources? If you move those files to a .jar file the resources won't be files anymore and (of course) can't be found anymore. (think of Icons etc.)

kind regards,

Jos
Apr 6 '09 #2

P: 50
Ok sir,

That should be the problem.

But How could a value be converted to icon ?

Thank you.
Apr 6 '09 #3

Expert 10K+
P: 11,448
@uhdam
That was just an example; suppose you have a small .gif file and you load that file as an Icon; if you move that .gif file to a .jar file the .gif file doesn't exist anymore; don't think too much of it.

kind regards,

Jos
Apr 6 '09 #4

P: 50
Ok sir.

Actually, I am using XML file system. I am Retrieving XML elements using DOM parser and Storing elements as class Attributes. While executing the parsed file alone (fileScanner.java) i am getting the attribute values properly. But when accessing fileScanner.java through .jar files, i am getting Null Pointer Exception for the same attribute value.

How to rectify this and execute the same.

Thank you.
Apr 6 '09 #5

Expert 10K+
P: 11,448
@uhdam
We don't know, you haven't shown us any code. Check all your code and see where you want to open a file and if you stuck that file in your .jar file. That causes the problem.

kind regards,

Jos
Apr 6 '09 #6

Post your reply

Sign in to post your reply or Sign up for a free account.