在 Java 版本 7u45 (NPE) 之后 Java Web 启动不起作用 [英] Java web start doesn't work after java version 7u45 (NPE)

查看:35
本文介绍了在 Java 版本 7u45 (NPE) 之后 Java Web 启动不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的 java 应用程序是通过 java web start 启动的(使用 glassfish 4.0).更新到 java 7u45 后,它不再工作了.这是错误信息:

Our java application is launchend via java web start (with glassfish 4.0). After updating to java 7u45, it doesn't work anymore. Here is the error message:

java.lang.NullPointerException
at java.io.StringReader.<init>(Unknown Source)
at org.glassfish.appclient.client.JWSAppClientContainerMain.insertMaskingLoader(JWSAppClientContainerMain.java:186)
at org.glassfish.appclient.client.JWSAppClientContainerMain.main(JWSAppClientContainerMain.java:132)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.javaws.Launcher.executeApplication(Unknown Source)
at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

这会在下载完成后立即发生.快速查看 GF 源文件后,似乎没有定义属性 loader.config 作为第二行抛出 NPE:

This happens right after the download finished. After a quick look into the GF source file, it seems that the property loader.config is not defined as the second line throws the NPE:

final String loaderConfig = System.getProperty("loader.config");
StringReader sr = new StringReader(loaderConfig);

编辑NPE 发生的以上两行代码是 Glassfish 代码,来自 jar gf-client-module.jar 中的 Class JWSAppClientContainerMain.它一直工作到 Java 更新 45.

EDIT The above two code lines where the NPE happens is Glassfish code, from the Class JWSAppClientContainerMain in the jar gf-client-module.jar. It worked until java update 45.

推荐答案

从更新 45 开始,JavaWebstart 将不再将不安全的属性传递给您的应用程序.所有没有以 jnlpjavaws 为前缀的属性都被认为是不安全的.

As of Update 45, JavaWebstart will no longer pass insecure properties to your application. All properties that are not prefixed with jnlp or javaws are considered insecure.

您要么需要将 loader.config 更改为 jnlp.loader.config(在 JNLP 以及您的 java 代码中),或者您需要签署JNLP(将 JNLP 的精确副本放在JNLP-INF/APPLICATION.JNLP 在您的 jar 中并在 jar 中签名).

You either need to change loader.config to jnlp.loader.config (both in the JNLP as well as your java code), or you need to sign the JNLP (place an exact copy of your JNLP in JNLP-INF/APPLICATION.JNLP inside your jar and sign the jar).

根据这个 OpenJDK 错误报告 这是一个解决安全问题的有意更改漏洞

According to this OpenJDK Bugreport this is an intentional change to resolve a security vulnerability

这篇关于在 Java 版本 7u45 (NPE) 之后 Java Web 启动不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆