Hello All,
I am having trouble launching an
applet from a HTML page.
I am using the Netbeans environment.
I have two projects.
ivMonitor is a web application and produces a .war file
ivApplets is a library that produces a .jar file
ivApplets has one applet, HelloJim.java which extends JApplet.
The ivMonitor project packages the ivApplets.jar file
When the .war file is deployed I get the following hierarchy of files.
apache\webapps\ivMonitor\testApplet.html
apache\webapps\ivMonitor\WEB-INF\classes
apache\webapps\ivMonitor\WEB-INF\lib\ivmApplets.jar
The ivmApplets.jar file contains the files
classes\HelloJim.class
classes\HelloJim$1.class
The testApplet.html file is
I have tried adding a codebase line with various permutations, to no avail.
HelloJim.java is not in a package.
Below is the error from the JVM from the code above (with .class in the code=).
I can get the 'Caused by:' line below
load: class HelloJim.class not found.
java.lang.ClassNotFoundException: HelloJim.class
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.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)
Caused by: java.io.IOException: open HTTP connection failed:http://localhost:8080/ivMonitor/HelloJim/class.class
at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 7 more
Exception: java.lang.ClassNotFoundException: HelloJim.class
If I change the applet html and drop the '.class' in the code=,
I get a similar, but closer I think, error:
oad: class HelloJim not found.
java.lang.ClassNotFoundException: HelloJim
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.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)
Caused by: java.io.IOException: open HTTP connection failed:http://localhost:8080/ivMonitor/HelloJim.class
at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 7 more
Exception: java.lang.ClassNotFoundException: HelloJim
The real path to the class file is
http://localhost:8080/ivMonitor/WEB-INF/lib/ivmApplets.jar/HelloJim.class
I even tried copying the .jar file from the lib folder to the root of the .war file so it was in the same
folder as the html page, but it still doesn't work.
Any Help would be appreciated.
Thanks!!