views:

144

answers:

2
I have embedded an applet (jar file)in a html page 

Now when I am trying to access the web page , it is giving the following error.

<APPLET CODE="com.xxx.tru.ReadNFCSerialNumber" NAME="Read" ID="Read" MAYSCRIPT alt="Photo Id"   ARCHIVE="\test.jar, \ojdbc14.signed.jar, \ojdbc14_g.signed.jar" WIDTH="100%"  HEIGHT="100%"  HSPACE="1"  VSPACE="1">
</APPLET>




load: class com.xxx.tru.ReadNFCSerialNumber not found.
java.lang.ClassNotFoundException: com.xxx.tru.ReadNFCSerialNumber
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/popit/POPit/com/xxx/tru/ReadNFCSerialNumber.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: com.xxx.tru.ReadNFCSerialNumber

What am i doing wrong??

+1  A: 

The web browser is trying to load your class from the URI http://localhost/popit/POPit/com/xxx/tru/ReadNFCSerialNumber.class instead of your jar file. The contents of the ARCHIVE attribute looks suspicious to me. Is it really supposed to be a comma-and-space delimited list? Also, the backslashes in front of the file names look suspicious:

ARCHIVE="\test.jar, \ojdbc14.signed.jar, \ojdbc14_g.signed.jar"

I would suggest you look into fixing the ARCHIVE attribute and then see if the web browser will load the class file form the jar as you want it to do.

liwp
A: 

the CODEBASE attribute is missing. just a thought.code base

ultrajohn