【问题标题】:Java Web Start manifest issueJava Web Start 清单问题
【发布时间】:2013-12-06 19:03:13
【问题描述】:

我正在尝试通过 java web start 使 swing-app 可再发行。我用 netbeans 7.4 构建 jar 和 jnlp。

通过网络下载应用程序时收到此消息。(抱歉西班牙语) 但它说 manifest.mf 不包含权限属性。

我没有使用受信任的证书(由 CA),我使用 netbeans 工具自己创建了密钥库。

在project.properties我放

# Optional override of default Codebase manifest attribute, use to prevent RIAs from being repurposed
manifest.custom.codebase=http://150.1.1.32:8084/
# Optional override of default Permissions manifest attribute (supported values: sandbox, all-permissions)
manifest.custom.permissions=all-permissions
manifest.file=manifest.mf

当我从主 jar 中看到构建 jar 清单后,所有依赖项 jar 都具有属性 all-permissions

Permissions: all-permissions
Created-By: 1.7.0_45-b18 (Oracle Corporation)
Main-Class: com.onix.sirf.gui.executors.SwingExecutor
Codebase: http://150.1.1.32:8084/

这是我的jnlp

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<jnlp codebase="http://150.1.1.32:8084/" href="sirf.jnlp" spec="1.0+">
    <information>
        <title>title</title>
        <vendor>blabla</vendor>
        <homepage href="http://www.blabla.com"/>
        <description>Some description</description>
        <description kind="short">HelloWorld</description>
    </information>
    <update check="always"/>
    <security>
<all-permissions/>
</security>
    <resources>
        <j2se version="1.7+"/>
        <jar href="frontend.jar" main="true"/>
    <jar href="lib/commons-lang3-3.1.jar"/>
<jar href="lib/jcalendar-1.4.jar"/>
<jar href="lib/log4j-1.2.17.jar"/>
<jar href="lib/swingx-all-1.6.4.jar"/>
 -- there are some more libraries
<extension href="jnlpcomponent1.jnlp"/> -- here is one more library sqljdbc4.jar
</resources>
    <application-desc main-class="com.onix.sirf.gui.executors.SwingExecutor">
    </application-desc>
</jnlp>

还有jnlpcomponent1.jnlp

<jnlp codebase="http://150.1.1.32:8084/" href="jnlpcomponent1.jnlp" spec="1.0+">
    <information>
        <title>jnlpcomponent1</title>
        <vendor>MSFTSIG</vendor>
    </information>
    <security>
        <all-permissions/>
    </security>
    <resources>
        <jar href="lib/sqljdbc4.jar" download="eager"/>
    </resources>
    <component-desc/>
</jnlp>

【问题讨论】:

    标签: java swing netbeans jnlp


    【解决方案1】:

    我解决了。

    在jnlpcomponent1.jnlp 中,我看到sqljdbc4.jar 已由微软签名。

    当我查看它的manifest.mf 时,它没有Permissions: all-permissions 属性。所以我从sqljdbc4.jar 中删除所有清单文件并放置一个空文件(也删除MSFTSIG.SF 和MSFTSIG.RSA)。现在用我的签名和清单文件中的Permissions: all-permissions 再次构建应用程序,就像一个魅力。

    【讨论】:

    • 这个answer 提出了一种更简单的更新清单文件的方法。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2010-12-06
    • 1970-01-01
    • 1970-01-01
    • 2010-12-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多