这应该属于安全限制问题,在appletViewer里面applet是当作本地应用程序的,不受功能限制。但是如果在ie中就要受限制,在网络方面的限制就是只能连接下载这个applet的主机,不能连接其他主机。 解决方法是给applet做一个签名。 签名方法如下: Signing JAR Files with a Test Certificate Here are the steps needed to sign a JAR file with a test certificate: Make sure that you have a JDK 1.2 or JDK 1.3 keytool and jarsigner in your path (located in the J2SE SDK bin directory). Create a new key in a new keystore as follows: keytool -genkey -keystore myKeystore -alias myself You will get prompted for a information about the new key, such as password, name, etc. This will create the myKeystore file on disk. Then, create a self-signed test certificate as follows: keytool -selfcert -alias myself -keystore myKeystore This will prompt for the password. Generating the certificate takes a few minutes. Check to make sure that everything is ok. To list the contents of the keystore, use the command: keytool -list -keystore myKeystore It should list something like: Keystore type: jks Keystore provider: SUNYour keystore contains 1 entry:myself, Tue Jan 23 19:29:32 PST 2001, keyEntry, Certificate fingerprint (MD5): C2:E9:BF:F9:D3:DF:4C:8F:3C:5F:22:9E:AF:0B:42:9DFinally, sign the JAR file with the test certificate as follows: jarsigner -keystore myKeystore test.jar myself Repeat this step on all of your JAR files. 访问的时候: <applet width="200" height="300" archive="file.jar" code="Download.class"> </applet> 但是有个限制,就是访问的机器上一定要安装sun公司的java虚拟机,就是webstart,不安装ie还是没有办法访问的。
这是我在java控制台中显示的错误信息: com.ms.security.SecurityExceptionEx[com/inprise/vbroker/properties/PropertyManager.<clinit>]: Unable to access system property: java.class.path
com.ms.security.SecurityExceptionEx[com/inprise/vbroker/properties/CommandLineProcessor.process]: Unable to access system properties.这应该怎么处理,是不是要改安全文件,怎么改?请高手指点!!
解决方法是给applet做一个签名。
签名方法如下:
Signing JAR Files with a Test Certificate
Here are the steps needed to sign a JAR file with a test certificate: Make sure that you have a JDK 1.2 or JDK 1.3 keytool and jarsigner in your path (located in the J2SE SDK bin directory). Create a new key in a new keystore as follows:
keytool -genkey -keystore myKeystore -alias myself
You will get prompted for a information about the new key, such as password, name, etc. This will create the myKeystore file on disk. Then, create a self-signed test certificate as follows:
keytool -selfcert -alias myself -keystore myKeystore
This will prompt for the password. Generating the certificate takes a few minutes. Check to make sure that everything is ok. To list the contents of the keystore, use the command:
keytool -list -keystore myKeystore
It should list something like:
Keystore type: jks
Keystore provider: SUNYour keystore contains 1 entry:myself, Tue Jan 23 19:29:32 PST 2001, keyEntry,
Certificate fingerprint (MD5):
C2:E9:BF:F9:D3:DF:4C:8F:3C:5F:22:9E:AF:0B:42:9DFinally, sign the JAR file with the test certificate as follows:
jarsigner -keystore myKeystore test.jar myself
Repeat this step on all of your JAR files.
访问的时候:
<applet width="200" height="300" archive="file.jar" code="Download.class">
</applet>
但是有个限制,就是访问的机器上一定要安装sun公司的java虚拟机,就是webstart,不安装ie还是没有办法访问的。
jarsigner -keystore myKeystore vbjorb.jar myself
出现下面的错误:
jarsigner: unable to sign jar: java.util.zip.ZipException: invalid entry crc-32
(expected 0xaaf5a674 but got 0x180e78b3)
另外,我在本机的ie上也需要签名吗?
然后在运行applet的时候点击图标可以查看错误消息.另外, 远程调试可能会有帮助!
com.ms.security.SecurityExceptionEx[com/inprise/vbroker/properties/PropertyManager.<clinit>]: Unable to access system property: java.class.path
com.ms.security.SecurityExceptionEx[com/inprise/vbroker/properties/CommandLineProcessor.process]: Unable to access system properties.这应该怎么处理,是不是要改安全文件,怎么改?请高手指点!!