Solved

JNLP error

Posted on 2008-11-02
6
544 Views
Last Modified: 2012-05-05
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)
0
Comment
Question by:zolf
  • 3
  • 2
6 Comments
 

Author Comment

by:zolf
Comment Utility

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

0
 
LVL 7

Expert Comment

by:humanonomics
Comment Utility
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.
0
 

Author Comment

by:zolf
Comment Utility

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/">

<information>

  <title>Time Check</title>

  <vendor>Java Developer Connection</vendor>

  <homepage href="/jdc" />

  <description>Demonstration of JNLP</description>

</information>

<offline-allowed/>

<security>

  <all-permissions/>

</security>

<resources>

  <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"/>

</resources>

<application-desc main-class="com.MainForm" />

</jnlp>

Open in new window

0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:zolf
Comment Utility

i also removed the space between the image file name, just in case.but no luck
0
 
LVL 7

Expert Comment

by:humanonomics
Comment Utility
Please give the directory structure
0
 
LVL 27

Accepted Solution

by:
rrz earned 500 total points
Comment Utility
Did you try ?
   ClassLoader cl = this.getClass().getClassLoader();
   Icon icon  = new ImageIcon(cl.getResource("images/SplashScreen2.jpg"));
see
http://java.sun.com/javase/6/docs/technotes/guides/javaws/developersguide/development.html#retrieving
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
This video teaches viewers about errors in exception handling.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now