简体   繁体   English

将JNLP修复为JRE 1.6并安装JRE 1.7时,Java WebStart启动失败

[英]Java WebStart launch fails when a JNLP is fixed to JRE 1.6 and JRE 1.7 is installed

At my company, we download and launch a JNLP application that is tied to a JRE 1.6.0_20. 在我的公司,我们下载并启动了一个与JRE 1.6.0_20绑定的JNLP应用程序。 We use the system cache feature to download the JARs. 我们使用系统缓存功能下载JAR。

When we install a JRE 1.7 on the PC, WebStart fails to launch. 当我们在PC上安装JRE 1.7时,WebStart无法启动。 When we enable the logs, we see the following exception: 当我们启用日志时,我们会看到以下异常:

java.lang.ExceptionInInitializerError
    at com.sun.deploy.net.protocol.https.Handler.openConnection(Unknown Source)
    at java.net.URL.openConnection(Unknown Source)
    at com.sun.deploy.net.BasicHttpRequest.createUrlConnection(Unknown Source)
    at com.sun.deploy.net.BasicHttpRequest.doRequest(Unknown Source)
    at com.sun.deploy.net.BasicHttpRequest.doGetRequestEX(Unknown Source)
    at com.sun.deploy.net.DownloadEngine.actionDownload(Unknown Source)
    at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source)
    at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source)
    at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)
    at com.sun.deploy.net.DownloadEngine.getCachedFile(Unknown Source)
    at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
    at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(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)
Caused by: java.lang.ClassCastException: sun.security.ssl.X509TrustManagerImpl cannot be ast to com.sun.net.ssl.internal.ssl.X509ExtendedTrustManager
    at com.sun.deploy.security.X509ExtendedDeployTrustManager.<init>(Unknown Source)
    at com.sun.deploy.net.protocol.https.Handler$Initializer$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.deploy.net.protocol.https.Handler$Initializer.<clinit>(Unknown Source)
... 16 more

Is there a known workaround? 有一个已知的解决方法吗?

This is an installation issue, plugin launch problem for multiple JRE. 这是一个安装问题,多个JRE的插件启动问题。 Reinstall all plugin with updated JRE. 使用更新的JRE重新安装所有插件。 See bug database 查看bug数据库

This may not apply well to your situation, but I found a solution for this for our problem. 这可能不适合您的情况,但我找到了解决此问题的解决方案。 I modified the JNLP file to specify what JRE to use. 我修改了JNLP文件以指定要使用的JRE。 In our case, the JNLP file had the following: 在我们的例子中,JNLP文件具有以下内容:

<j2se java-vm-args="-Xmx512m -Dsun.java2d.noddraw=true" version="1.6+"/>

And apparently, the " 1.6+ " allows for execution under 1.7. 显然,“ 1.6+ ”允许在1.7以下执行。 So I removed the " + ", like so: 所以我删除了“ + ”,就像这样:

<j2se java-vm-args="-Xmx512m -Dsun.java2d.noddraw=true" version="1.6"/>

And now the application works fine. 现在应用程序运行正常。 If you can change the JNLP file that gets served via your application URL, that would be best. 如果您可以更改通过应用程序URL提供的JNLP文件,那将是最好的。 In our case, that wasn't an option (the JNLP comes from a 3rd party software package), so I downloaded the JNLP, edited it, and now we launch the application by double-clicking the modified .jnlp file (or running the 1.6 javaws.exe on it). 在我们的例子中,这不是一个选项(JNLP来自第三方软件包),所以我下载了JNLP,编辑了它,现在我们通过双击修改后的.jnlp文件启动应用程序(或运行1.6 javaws.exe就可以了)。

Here is some documentation on the JNLP file format if you need further information. 如果您需要更多信息,请参阅以下有关JNLP文件格式的文档

In my case, the following worked to resolve this issue - 在我的情况下,以下工作解决了这个问题 -

I needed to add the '*', which implies that the latest 1.6 JRE found on the machine will be picked up. 我需要添加'*',这意味着将在机器上找到最新的1.6 JRE。 For some reason, just using '1.6' did not work for me, and 1.7 continued to block the launch. 出于某种原因,仅使用'1.6'对我来说不起作用,并且1.7继续阻止发布。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM