Search code examples
javajarappletsigned-applet

Unable to sign the jar file properly


I have TViewerApplet.class in com.abc.applet package.To sign the jar file I followed following steps:

1) Created jar file of com folder using cmd jar cf Viewer.jar com

2) Signed jar file using cmd

 jarsigner -keystore "C:\Documents and Sett
ings\compstore" -storepass abcdef -keypass abcdef
-signedjar "C:\Documents and Settings\SignedViewer
.jar" "C:\Documents and Settings\Viewer.jar" signFiles

Added the below tag in jsp file

<applet name="viewerApplet" id="TViewerApplet" width="100%" height="500" code="com.abc.applet" align="baseline" codebase="." mayscript="mayscript" archive="SignedViewer.jar,cmbview81.jar"> </applet>

But the problem is I get

Caused by: java.io.IOException: open HTTP connection failed:http://10.160.120.221:8086/ICMViewer/com/abc/applet.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)
    ... 9 more
Exception: java.lang.ClassNotFoundException: com.abc.applet

Solution

  • Looks like the problem is not that you signed your applet, but rather that it's a misconfiguration of your applet-tag in html.