2012-07-26 78 views
0

我TViewerApplet.class在com.abc.applet package.To簽署jar文件我也跟着下面的步驟:無法註冊jar文件正確

1)的COM文件夾的創建jar文件使用CMD jar cf Viewer.jar com

2)簽名的JAR文件使用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 

添加以下標記中的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>

但問題是,我得到

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

貌似問題不是你籤你的applet,而是它在HTML你的applet標籤的錯誤配置。

+0

是applet-tag的代碼屬性的問題? – happy 2012-07-26 06:43:24

+0

您可以在代碼屬性中指定小程序的文件名。看看定義,在我看來,你只定義了包的名稱。 – 2012-07-26 06:46:56