Java Web Start 清单问题 [英] Java Web Start manifest issue
问题描述
我正在尝试通过 java web start 制作可重新分发的 Swing 应用程序.我用 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
已经被微软签名了.
In jnlpcomponent1.jnlp
i see that sqljdbc4.jar
is already signed by microsoft.
当我查看它的 manifest.mf
时,它没有 Permissions: all-permissions
属性.所以我从 sqljdbc4.jar
中删除了所有清单文件并放了一个空的(也删除 MSFTSIG.SF
和 MSFTSIG.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 清单问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!