Java Launch 在第二次运行时失败:java.lang.NullPointerException
我下载了 .jnlp 文件并运行它。它运行良好。我关闭它并重新启动它,它运行良好。
然而,在第三次尝试时,它总是抛出 java.lang.NullPointerException 并且应用程序将无法启动。
如果我重新启动计算机,它会再次工作。我该如何解决这个问题?
java.lang.NullPointerException
at com.sun.javaws.security.SigningInfo.overlapSigners(Unknown Source)
at com.sun.javaws.security.SigningInfo.getCertificates(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)
I downloaded the .jnlp file and ran it. It runs fine. I close it and start it again, it runs fine.
However on the third try, it always throws java.lang.NullPointerException and the application will not launch.
If I restart the computer it works again. How can I fix this ?
java.lang.NullPointerException
at com.sun.javaws.security.SigningInfo.overlapSigners(Unknown Source)
at com.sun.javaws.security.SigningInfo.getCertificates(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)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
堆栈跟踪与 Bug ID 6533653 和 错误 ID 6850598。根本原因似乎是 JNLP 中的空 JAR。他们表示已分别在 Java 1.6 update 2 和 Java 1.6 update 18 中修复了该问题。
然而,最后一个错误中有一条评论抱怨该修复在 1.6 update 18 中仍然不起作用,并且还有一个看起来很像您的情况的描述:
因此,请尝试从 JNLP 中删除空 JAR 并将其报告给 JNLP 作者。
The stacktrace is the same as in Bug ID 6533653 and Bug ID 6850598. The root cause seems to be an empty JAR in JNLP. They said to have fixed it in Java 1.6 update 2 and Java 1.6 update 18 respectively.
However, there is a comment in the last bug which complains that the fix still doesn't work in 1.6 update 18, along with a description which look much like your situation:
So, try removing the empty JAR from the JNLP and report it to the JNLP authors as well.
对于版本 1.6.0_18 的用户,我们也看到了此问题。
我查看了 jnlp 文件中列出的 jar,发现一个许可证 jar 跳出来,可能是没有类的 jar 的候选者。我用
jar tf
确认了这一点。作为快速测试,我从 jnlp 文件中删除了 jar,但没有收到错误。但是,我需要第三方库的许可证 jar。
我更新了我的构建文件,将许可证 jar 捆绑到我的应用程序 jar 中。
第 3 方库可以在类路径中找到许可证信息,并且不再出现错误!
We saw this issue as well for users with version 1.6.0_18.
I took a look at the jars listed in my jnlp file and found a license jar jumped out as a likely candidate for a jar with no classes. I confirmed this with
jar tf
.As a quick test I removed the jar from the jnlp file and I did not get the error. However, I needed the license jar for a 3rd party library.
I updated my build file to bundle the license jar into my application jar
The 3rd party library could locate the license info in the classpath and no more errors!