通过远程访问运行 Java Web Start 时遇到问题。虽然我的 jar 已签名,但我收到控制台异常和错误:“无法启动应用程序”。例外:
com.sun.deploy.net.JARSigningException: Found unsigned entry in resource: http://hostmachine/myapp.jar
at com.sun.javaws.security.SigningInfo.getCommonCodeSignersForJar(Unknown Source)
at com.sun.javaws.security.SigningInfo.check(Unknown Source)
at com.sun.javaws.LaunchDownload.checkSignedResourcesHelper(Unknown Source)
at com.sun.javaws.LaunchDownload.checkSignedResources(Unknown Source)
at com.sun.javaws.Launcher.prepareResources(Unknown Source)
at com.sun.javaws.Launcher.prepareAllResources(Unknown Source)
at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
at com.sun.javaws.Launcher.launch(Unknown Source)
at com.sun.javaws.Main.launchApp(Unknown Source)
at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
at com.sun.javaws.Main$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
我的 index.html:
<body>
<!-- ... -->
<script src=
"http://www.java.com/js/deployJava.js"></script>
<script>
// using JavaScript to get location of JNLP
// file relative to HTML page
var dir = location.href.substring(0,
location.href.lastIndexOf('/')+1);
var url = dir + "myapp.jnlp";
deployJava.createWebStartLaunchButton(url, '1.6.0');
</script>
<!-- ... -->
myapp.jnlp:
<?xml version="1.0" encoding="UTF-8"?><jnlp spec="1.0+" codebase="http://hostmachine" href="myapp.jnlp">
<information>
<title>title</title>
<vendor>company</vendor>
<offline-allowed/>
</information>
<security>
<all-permissions/>
</security>
<resources>
<!-- Application Resources -->
<j2se version="1.6+" href=
"http://java.sun.com/products/autodl/j2se"/>
<jar href="myapp.jar"
main="true" />
</resources>
<application-desc
name="name">
</application-desc>
<update check="background"/>
我的keygen.bat:
"C:\Program Files (x86)\Java\jre7\bin\keytool" -genkey -keystore myapp.keys -keypass mypass -alias jaxb-workshop.dev.java.net -validity 256
我的 jarsigner.bat:
C:\glassfish3\jdk\bin\jarsigner.exe -keystore myapp.keys -storepass mypass myapp.jar jaxb-workshop.dev.java.net
C:\glassfish3\jdk\bin\jarsigner.exe -verify -certs -verbose -keystore myapp.keys myapp.jar jaxb-workshop.dev.java.net
任何人都可以帮忙吗?