File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JNLP and Web Start and the fly likes WebStart ClassNotFoundException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JNLP and Web Start
Bookmark "WebStart ClassNotFoundException" Watch "WebStart ClassNotFoundException" New topic
Author

WebStart ClassNotFoundException

Brian Drelling
Ranch Hand

Joined: Oct 02, 2009
Posts: 42
I recently tried to use WebStart after reading up about it in the Head First Java book, and with a thorough understanding of how it worked (I thought), I went to go put the files onto my website to try out.

Long story short, it failed. I tested the JAR file before uploading and it ran like a champ! However, once I uploaded it and ran my JNLP, I got a few issues. After fixing them, it finally cuts it down to just the following error:

"Unable to launch the application."

So I clicked details and copied the two tabs below. I removed my website's name for protection. I put foo in its place.

Launch File:


Exception:



Looking offhand, could anyone tell me if I am making an obvious mistake?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18991
    
    8

I don't know... using antique versions of JNLP and Java might be a mistake. I'm using version 6.0 of JNLP and version 1.6 of Java. However I compared your JNLP file to mine and I noticed that I used another attribute in my <jar> element:

I forget what that means but you could look it up.
Brian Drelling
Ranch Hand

Joined: Oct 02, 2009
Posts: 42
Antique versions of JNLP how?

And, err, what do you mean by antique versions of Java? Are you talking about the "1.3+" command?

I was fairly sure that just meant that it would check to make the user had at least Java 1.3 or higher so they could run the program required. Maybe I need to require a higher version? Could that make a difference or would the user only get an error if they didn't have the right version?

Like, say my program required Java 6, but I put "1.3+" in the title and the user didn't have Java 6. Would it give an error when trying to load up the JNLP like above, or would it give an error once it tries to load the program and realizes it wouldn't work?

Did that question make sense?


Also, I still can't get it to work...
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18991
    
    8

Brian Drelling wrote:Antique versions of JNLP how?
You've specified version 1.0 of JNLP. The current version is 6.0. If you need to use version 1.0 then you should check that it supports all of the elements you use there. You would only need to use an old version if you knew that you had clients which didn't support anything later than that and they were incapable of upgrading.
And, err, what do you mean by antique versions of Java? Are you talking about the "1.3+" command?

I was fairly sure that just meant that it would check to make the user had at least Java 1.3 or higher so they could run the program required. Maybe I need to require a higher version? Could that make a difference or would the user only get an error if they didn't have the right version?

Like, say my program required Java 6, but I put "1.3+" in the title and the user didn't have Java 6. Would it give an error when trying to load up the JNLP like above, or would it give an error once it tries to load the program and realizes it wouldn't work?
Yes, that is what it means. I just don't understand why you would specify that when even Java 1.4 is no longer supported. It shouldn't matter and it probably isn't the source of your problem.
Also, I still can't get it to work...
Have you verified that JNLP has actually downloaded your jar file? If it hasn't then that's your problem. If it has, then the problem is that it can't find the class in the jar. Since you say it's there, then perhaps the JNLP classloader can't load classes which aren't in a package.
Brian Drelling
Ranch Hand

Joined: Oct 02, 2009
Posts: 42
Great, thank you. I'll take a look at this stuff and report back if it is working or not.

Thanks again!
Brian Drelling
Ranch Hand

Joined: Oct 02, 2009
Posts: 42
Okay, so I've tried some things...

You've specified version 1.0 of JNLP. The current version is 6.0. If you need to use version 1.0 then you should check that it supports all of the elements you use there. You would only need to use an old version if you knew that you had clients which didn't support anything later than that and they were incapable of upgrading.


I upped that number to 6.0 and made sure the syntax was right.

Yes, that is what it means. I just don't understand why you would specify that when even Java 1.4 is no longer supported. It shouldn't matter and it probably isn't the source of your problem.


Changed this bit to "1.6+" instead.

Have you verified that JNLP has actually downloaded your jar file? If it hasn't then that's your problem. If it has, then the problem is that it can't find the class in the jar. Since you say it's there, then perhaps the JNLP classloader can't load classes which aren't in a package.


Everything I have is in a proper package, and I don't know if it downloading my JAR file. I mean, how can I tell exactly? Where would it download the JAR file to? (Sorry if this is a stupid question.)

I don't get why it isn't working. I can run the JAR file independently and it works fine, but I just can't get it to work using JNLP... Everything is in a package, the class being chosen to run is perfect, everything should be fine.

This is very frustrating as the error doesn't even describe to me what could be wrong, just tells me the class isn't found--obviously it exists or the program wouldn't work by itself, so what gives?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18991
    
    8

Brian Drelling wrote:Everything I have is in a proper package, and I don't know if it downloading my JAR file. I mean, how can I tell exactly? Where would it download the JAR file to? (Sorry if this is a stupid question.)

It's in a package? Then you should say so in your JNLP file. Right here:

If you don't provide the fully-qualified class name then the classloader won't be able to find it.
Brian Drelling
Ranch Hand

Joined: Oct 02, 2009
Posts: 42
Nice! I had no idea.

The Web Start tutorials I read only used a single class in a JAR file as an example. I forgot to do anything with packages...

It is working perfectly now. Thank you, Paul!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: WebStart ClassNotFoundException