开发者

Java Launch fails on second run: java.lang.NullPointerException

开发者 https://www.devze.com 2023-01-29 04:06 出处:网络
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 n

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)


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.


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!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号