Java Launch 在第二次运行时失败:java.lang.NullPointerException

发布于 2024-10-07 04:44:46 字数 1038 浏览 10 评论 0原文

我下载了 .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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

谁把谁当真 2024-10-14 04:44:46

堆栈跟踪与 Bug ID 6533653错误 ID 6850598。根本原因似乎是 JNLP 中的空 JAR。他们表示已分别在 Java 1.6 update 2 和 Java 1.6 update 18 中修复了该问题。

然而,最后一个错误中有一条评论抱怨该修复在 1.6 update 18 中仍然不起作用,并且还有一个看起来很像您的情况的描述:

在 vm 6u18 中,此错误并未关闭。 您可以启动应用程序一次,但出现以下异常后

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)

如果我从 jnlp 中删除空罐子,一切都会好起来。
请在发布前验证您的更正

因此,请尝试从 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:

In vm 6u18 this bug is NOT closed. You can launch your application once but after you have the following exception :

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)

If I remove the empty jar from jnlp, all is ok.
Please verify your correction before publication

So, try removing the empty JAR from the JNLP and report it to the JNLP authors as well.

暖树树初阳… 2024-10-14 04:44:46

对于版本 1.6.0_18 的用户,我们也看到了此问题。

我查看了 jnlp 文件中列出的 jar,发现一个许可证 jar 跳出来,可能是没有类的 jar 的候选者。我用 jar tf 确认了这一点。

作为快速测试,我从 jnlp 文件中删除了 jar,但没有收到错误。但是,我需要第三方库的许可证 jar。

我更新了我的构建文件,将许可证 jar 捆绑到我的应用程序 jar 中。

<jar jarfile="${dist}/lib/${application}.jar">
    <zipgroupfileset dir="${extLib}" includes="runtime.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

<jar jarfile="${dist}/lib/${application}.jar">
    <zipgroupfileset dir="${extLib}" includes="runtime.jar" />
...
</jar>

The 3rd party library could locate the license info in the classpath and no more errors!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文