正确签名的JNLP应用程序无法在Java 7中运行 [英] Correctly signed JNLP application prevented from running in Java 7

查看:78
本文介绍了正确签名的JNLP应用程序无法在Java 7中运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个JNLP应用程序,由于证书到期,因此需要对其进行更新。我有一个由CA验证的新证书。我已将新证书导入到密钥库中-已导入完整的证书链。

I have a JNLP application that needs to be updated due to a certificate expiry. I have a new certificate verified by a CA. I have imported the new certificate into my keystore - I have imported the full certificate chain.

我的构建文件签名并标记了我构建中的jars

My build file signs and timestamps the jars in my build

    <signjar alias="myAlias"
            keystore="myKeystore"
            storepass="storepass"
            keypass="keypass"
            lazy="false"
            tsaurl="http://timestamp.globalsign.com/scripts/timestamp.dll">
        <path>
            <fileset dir="${app.dist.dir}" includes="**/*.jar" />
        </path>
    </signjar>

编译后,我可以使用jarsigner来验证jar文件。一切都检查OK,没有任何警告的 jar验证。

After compilation I can verify the jar files using jarsigner. Everything checks out OK, "jar verified" with no warnings.

使用Java 6进行编译,并使用类似的方式运行应用程序

Compiling using Java 6 and running the application using something like this

"C:\Program Files\Java\jdk1.6.0_38\bin\javaws.exe" -verbose start.jnlp

工作正常。弹出窗口告诉我该应用程序已正确认证。我可以查看证书,而且看起来一切都很好。

works fine. Popup tells me the application is properly certificated. I can view the certificate and it all looks good.

使用Java 7进行编译,并使用类似的方法运行应用程序

Compiling using Java 7 and running the application using something like this

"C:\Program Files\Java\jdk1.7.0_51\bin\javaws.exe" -verbose start.jnlp

失败。 Java安全设置阻止了该应用程序的运行。您可以在Java控制面板中更改此行为。

fails. "Java security settings have prevented this application from running. You may change this behavior in the Java Control Panel"

我尝试将安全设置下移至中

I have tried moving the security settings down to Medium but this does not work and would not be a viable solution for me as this application is available on the internet.

我尝试用Java 6进行编译,并在Java 7上使用相同的程序运行结果。

I have tried compiling in Java 6 and running in Java 7 with the same results.

我没有收到任何错误消息。我已经花了几个小时了,在消除了许多问题和警告之后,我现在完全陷入了困境。我已经附加了JNLP文件,它对您有帮助!

I am getting no error messages. I have been going at this for hours now and after removing many problems and warnings along the way I am now completely stuck. I've attached the JNLP file it that helps!

<?xml version="1.0" encoding="UTF-8"?> 
<jnlp spec="6.0" codebase="http://localgocommunicate1.x.accessacloud.com:8080/a/theaccessgroup.com" href="http://localgocommunicate1.x.accessacloud.com:8080/a/theaccessgroup.com/client/desktop/start.jnlp">
    <information>
        <title>My App</title>
        <vendor>Company Ltd</vendor>
        <homepage href="http://www.myApp.com"/>
        <description>My App</description>
        <description kind="short">My App</description>      
        <icon href="http://localhost:8080/desktopclient/images/icon.gif"/>
        <icon kind="splash" href="http://localhost:8080/desktopclient/images/splash.gif"/>
        <offline-allowed/>
        <shortcut online="true">
            <menu submenu="Startup"/>
            <menu submenu="My App"/>
        </shortcut>
    </information>
    <security>
        <all-permissions/>
    </security>
    <update check="timeout" policy="always"/>
    <!-- Global Resource -->
    <resources>
        <j2se version="1.7*" java-vm-args="-Xmx32m" max-heap-size="32m" href="http://java.sun.com/products/autodl/j2se"/>
        <!-- App Common Resources -->
        <jar href="http://localhost:8080/desktopclient/6/myappclient.jar" download="eager"/>
        <jar href="http://localhost:8080/desktopclient/6/myappshared.jar" download="eager"/>
        <jar href="http://localhost:8080/desktopclient/6/myappclient.resources.jar" download="eager"/>
        <jar href="http://localhost:8080/desktopclient/6/myapplibrary.jar" download="eager"/>
        <!-- Common Resrouces -->
        <jar href="http://localhost:8080/desktopclient/6/lib/commons-logging-1.1.3.jar" download="eager"/>
        <jar href="http://localhost:8080/desktopclient/6/lib/log4j-1.2.17.jar" download="eager"/>
        <jar href="http://localhost:8080/desktopclient/6/lib/commons-beanutils-1.9.1.jar" download="eager"/>
        <jar href="http://localhost:8080/desktopclient/6/lib/commons-codec-1.9.jar" download="eager"/>
        <jar href="http://localhost:8080/desktopclient/6/lib/commons-collections-3.2.1.jar" download="eager"/>
        <jar href="http://localhost:8080/desktopclient/6/lib/commons-digester-2.1.jar" download="eager"/>
        <jar href="http://localhost:8080/desktopclient/6/lib/commons-fileupload-1.3.jar" download="eager"/>
        <jar href="http://localhost:8080/desktopclient/6/lib/commons-httpclient-3.1.jar" download="eager"/>
        <jar href="http://localhost:8080/desktopclient/6/lib/commons-io-2.4.jar" download="eager"/>
        <!-- JNA -->    
        <jar href="http://localhost:8080/desktopclient/6/lib/jna-4.0.0.jar"/>
    </resources>
    <!-- OS Specific Resources -->
    <resources os="Windows" arch="x86" href="http://java.sun.com/products/autodl/j2se">
        <jar href="http://localhost:8080/desktopclient/6/swt/swt-ws-win32-win32-x86.jar" />
    </resources>
    <resources os="Windows" arch="x86_64" href="http://java.sun.com/products/autodl/j2se">
        <jar href="http://localhost:8080/desktopclient/6/swt/swt-ws-win32-win32-x86_64.jar" />
    </resources>
    <resources os="Windows" arch="amd64" href="http://java.sun.com/products/autodl/j2se">
        <jar href="http://localhost:8080/desktopclient/6/swt/swt-ws-win32-win32-x86_64.jar" />
    </resources>
    <resources os="Mac OS X" arch="x86_64" href="http://java.sun.com/products/autodl/j2se">
        <j2se version="1.6+" java-vm-args="-XstartOnFirstThread"/>
        <jar href="http://localhost:8080/desktopclient/6/swt/swt-ws-cocoa-macosx-x86_64.jar" />
    </resources>
    <application-desc main-class="myappclient.Client">
        <argument>-version</argument>
        <argument>6</argument>
    </application-desc>
</jnlp>

任何帮助我们都会感激

推荐答案

好的,我有一个适合我的解决方案。

OK I have got a solution that works for me.


  1. 请确保您使用最新版本的JDK,在这种情况下为1.7.0_51-b13

  2. 更新JNLP文件以实施Java 1.7

  1. Make sure you compile using the latest version of the JDK, in this case 1.7.0_51-b13
  2. Update the JNLP file to enforce Java 1.7

<资源>

< j2se版本= 1.7 * java-vm-args =-Xmx32m max-heap-size = 32m href = http://java.sun.com / products / autodl / j2se />

<resources>
<j2se version="1.7*" java-vm-args="-Xmx32m" max-heap-size="32m" href="http://java.sun.com/products/autodl/j2se"/>

这篇关于正确签名的JNLP应用程序无法在Java 7中运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆