JNLP error

hello there,

i am trying to run my application using jnlp.but i get this error in the console.i can run the application with jar but with jnlp i get this error.please help.

Exception in thread "Thread-17" java.lang.NullPointerException
      at javax.swing.ImageIcon.<init>(Unknown Source)
      at com.FrmSplash.run(FrmSplash.java:11)
      at java.lang.Thread.run(Unknown Source)
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

zolfAuthor Commented:

the line 11 is shown below
JLabel SplashLabel = new JLabel(new ImageIcon(ClassLoader.getSystemResource("images/Splash Screen 2.jpg")));
public void run()
		JLabel SplashLabel = new JLabel(new ImageIcon(ClassLoader.getSystemResource("images/Splash Screen 2.jpg")));
		Dimension screen = 	Toolkit.getDefaultToolkit().getScreenSize();

Open in new window

it seems, your application is is not picking up the image file and hence "ClassLoader.getSystemResource("images/Splash Screen 2.jpg")" returns null, which results in that exception.
zolfAuthor Commented:

what do i need to do.please help.below is my jnlp file.the application runs fine using java -jar erp.jar
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="file:///C:/JNLP/">
  <title>Time Check</title>
  <vendor>Java Developer Connection</vendor>
  <homepage href="/jdc" />
  <description>Demonstration of JNLP</description>
  <j2se version="1.2+" />
  <jar href="erp.jar"/>
  <jar href="looks-2.2.0.jar"/>
  <jar href="sqljdbc.jar"/>
  <jar href="calendar-0.10.jar"/>
  <jar href="commons-collections-3.2.jar"/>
  <jar href="commons-logging-1.1.jar"/>
  <jar href="iText-2.1.3.jar"/>
  <jar href="jasperreports-3.0.0.jar"/>
  <jar href="jcalendar-1.3.2.jar"/>
  <jar href="looks-2.2.0.jar"/>
  <jar href="validation-2.0.1.jar"/>
<application-desc main-class="com.MainForm" />

Open in new window

Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

zolfAuthor Commented:

i also removed the space between the image file name, just in case.but no luck
Please give the directory structure
Did you try ?
   ClassLoader cl = this.getClass().getClassLoader();
   Icon icon  = new ImageIcon(cl.getResource("images/SplashScreen2.jpg"));

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.