站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JDK 5 Documentation v6.0, Java 2 SDK 英文文档

Signed applet upgraded from .cab to .jar files ... - JDK 5 Documentation v6.0, Java 2 SDK 英文文档

Signed applet upgraded from .cab to .jar files throws a security exception when run in Microsoft VM


Symptoms

After upgrading a signed applet from .cab to .jar files, the applet no longer works in the Microsoft VM. The applet runs fine in the Sun JRE.

Cause

This error is caused by a lack of signed .jar file support in the Microsoft VM. While the Microsoft VM supports unsigned .jar files through the archive attribute of the <APPLET> tag, classes and resources within signed .jar files are treated as untrusted in the Microsoft VM.

As a result, the applet is treated as untrusted by the Microsoft VM; any action performed by the applet that requires access outside the applet sandbox will likely result in a security exception.

Resolution

The only applet signing scheme recognized by the Microsoft VM is Authenticode used with .cab files.

The workaround is specify the upgraded .jar files through the archive attribute for the Sun JVM, and continue to specify the .cab files through cabbase for the Microsoft VM. For example,

<APPLET code="MyApplet" width=100 height=100>
<PARAM name="cabbase" value="package1.cab, package2.cab">
</APPLET>

should be changed to

<APPLET code="MyApplet" archive="package1.jar, package2.jar"
width=100 height=100>
<PARAM name="cabbase" value="package1.cab, package2.cab">
</APPLET>

Related Information

N/A