Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Loading Applet in Browser Using JNLP File

Hey guys, I am new here and was hoping someone might be able to help me understand what's going on with this JNLP hocus pocus.

Basically, I'm just trying to deploy a very simple applet using a .jnlp file. I created the applet in Eclipse and it runs fine in the IDE. I set up my jnlp and html files pretty much exactly how the tutorial on Sun's website suggests, but my stupidity seems to prevent the applet from working inside a browser.

The files I'm using are all in the same folder. They are:
[b]HiddenPrizePage.html[/b]
[b]HiddenPrizeTask.jar[/b]
[b]HiddenPrizeApplet.jnlp[/b]

I created my jar using Export in Eclipse with no compression, with the "Export generated class files and resources" checkbox selected. The [italic]images[/italic] folder contains all images used by the applet. The images folder is inside of [italic]src[/italic]. The program is structured so that the logic and drawing is done by HiddenPrizePanel.java and the applet itself is inside HiddenPrizeApplet.java.

[italic][b]MY HTML FILE:[/b][/italic]





var attributes = { code:'HiddenPrizeApplet', width:800, height:600} ;
var parameters = {jnlp_href: 'HiddenPrizeApplet.jnlp'} ;
deployJava.runApplet(attributes, parameters, '1.6');




[b][italic]MY JNLP FILE:[/italic][/b]

<?xml version="1.0" encoding="UTF-8"?>


Hidden Prize Task
Clinical Neuroscience Lab at OSU













When I try to run the applet inside of a browser, nothing happens. I can right-click the blank space on the page where the applet should theoretically be appearing and choose "Open Java Console" to check for error messages, so I did, and it says:

load: class components.HiddenPrizeApplet not found.
java.lang.ClassNotFoundException: components.HiddenPrizeApplet
at sun.plugin2.applet.Plugin2ClassLoader$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Unknown Source)
at sun.plugin2.applet.JNLP2ClassLoader.findClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception: java.lang.ClassNotFoundException: components.HiddenPrizeApplet
load: class components.HiddenPrizeApplet not found.
java.lang.ClassNotFoundException: components.HiddenPrizeApplet
at sun.plugin2.applet.Plugin2ClassLoader$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Unknown Source)
at sun.plugin2.applet.JNLP2ClassLoader.findClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception: java.lang.ClassNotFoundException: components.HiddenPrizeApplet



Can anyone help me figure out what I'm doing wrong? I don't understand why it says "components." in front of "HiddenPrizeApplet" whenever HPA is referenced, since I never refer to HPA as "components.HiddenPrizeApplet" in my jnlp or html files, and I certainly didn't put the java files or the class files or any other kinds of files in a folder or package named "components" to my knowledge. Thanks for any help you can provide.

Comments

Sign In or Register to comment.