JWS启动时拒绝PropertyPermission访问

时间:2011-11-25 13:16:06

标签: java jar jnlp executable-jar java-web-start

我是web-start的新手,我们正在使用exe4j从One-jar创建可执行文件。为了制作我们的应用程序的“web启动版本”,我正在尝试使用指定的Main-Class使用web start午餐One-JAR,但是我收到以下错误 -

 java.security.AccessControlException: access denied (java.util.PropertyPermission one-jar.main-class read)
    at java.security.AccessControlContext.checkPermission(Unknown Source)
    at java.security.AccessController.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
    at java.lang.System.getProperty(Unknown Source)
    at com.simontuffs.onejar.Boot.run(Boot.java:186)
    at com.simontuffs.onejar.Boot.main(Boot.java:137)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.sun.javaws.Launcher.executeApplication(Unknown Source)
    at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
    at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
    at com.sun.javaws.Launcher.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

JNLP包含 -

    <?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="" href="">
    <information>
        <title>Applet Takes Params</title>
        <vendor>Protype example</vendor>
    </information>
    <resources>
        <!-- Application Resources -->
        <j2se version="1.5+"
              href="http://java.sun.com/products/autodl/j2se"/>
        <jar href="Application.jar" main="true" />
    </resources>
    <application-desc main-class="com.simontuffs.onejar.Boot">
  </application-desc>
   <update check="background"/>
</jnlp>

我正在尝试直接启动 Application.jar com.simontuffs.onejar.Boot 是为JAR指定的主类。我也发现这个link表示我们无法通过web-start启动One-Jar。请帮忙。

1 个答案:

答案 0 :(得分:3)

access denied (java.util.PropertyPermission one-jar.main-class read)

一个网络启动应用。如果声明all-permissions,则可以访问任何属性。如果是沙盒,则只能访问前缀为jnlp&amp;的属性。其他一些被认为是“安全”的JRE属性。