本文介绍了Java Web Start清单问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过Java Web Start重新分发swing-app.我用netbeans 7.4构建jar和jnlp.

Im trying to make a swing-app redistributable via java web start. Im building jar and jnlp with netbeans 7.4.

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

Im getting this message when application is downloaded via web.(Sorry for spanish)But it says that manifest.mf doesn't contain permission attributes.

我没有使用(由CA认证的)受信任的证书,而是我自己通过netbeans工具创建了密钥库.

Im not using a trusted certificated (by CA) i created keystore by my own with netbeans tool.

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

And when i see after build jar manifest from main jar and all dependencies jar has the attribute 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>

推荐答案

我解决了.

jnlpcomponent1.jnlp中,我看到sqljdbc4.jar已经由Microsoft签名.

In jnlpcomponent1.jnlp i see that sqljdbc4.jar is already signed by microsoft.

当我查看其manifest.mf时,它没有属性Permissions: all-permissions.所以我从sqljdbc4.jar删除了所有清单文件,并放了一个空文件(也删除了MSFTSIG.SFMSFTSIG.RSA).现在,使用我的签名和清单文件中的Permissions: all-permissions再次构建应用程序,其工作方式就像一个超级按钮.

When i was looking to its manifest.mf it hasn't the attribute Permissions: all-permissions. So i delete all manifest file from sqljdbc4.jar and put an empty one (delete MSFTSIG.SF and MSFTSIG.RSA also). Build application again now with my signature and with Permissions: all-permissions in manifest file and works like a charm.

这篇关于Java Web Start清单问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 12:13