无法正确签署jar文件

时间:2012-07-26 06:36:03

标签: java jar applet signed-applet

我在com.abc.applet包中有TViewerApplet.class。要按照以下步骤签署jar文件:

1)使用cmd jar cf Viewer.jar com

创建com文件夹的jar文件

2)使用cmd签名的jar文件

 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

在jsp文件中添加了以下标记

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

但问题是我得到了

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

1 个答案:

答案 0 :(得分:1)

看起来问题不在于您是否签署了applet,而是在html中对applet-tag进行了错误配置。