启动Web启动应用程序时出现NullPointerException

时间:2011-10-27 13:48:46

标签: java nullpointerexception jnlp java-web-start

在最终解决了jar签名问题后(谢谢大家的帮助!),现在又出现了一个新问题。

尝试从launch.jnlp文件启动Web启动应用程序时,出现以下错误:

java.lang.NullPointerException
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)

如果我使用指向计算机上jar文件的jnlp文件,应用运行正常,但如果我尝试在网站中使用jar文件 - 我会收到上述错误。

究竟是什么问题?

jnlp文件格式正确,否则为什么它会在我的本地jar文件上运行?

这是jnlp:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<jnlp spec="1.0+">
    <information>
        <title>ExcelReader</title>
        <vendor>Adam</vendor>
        <homepage href="http://www.appquad.com"/>
        <description>ExcelReader</description>
        <description kind="short">ExcelReader</description>


    <offline-allowed/>
  </information>
    <update check="background"/>
    <security>
<all-permissions/>
</security>
    <resources>
       <j2se version="1.7+"/>
       <jar href="http://www.appquad.com/ExcelCopyApp/sExcelReader.jar" main="true"/>
       <jar href="http://www.appquad.com/ExcelCopyApp/lib/jxl.jar"/>
     </resources>
     <application-desc main-class="excelreader.ExcelCopyApp">

     </application-desc>
    </jnlp>

2 个答案:

答案 0 :(得分:2)

答案 1 :(得分:0)

我遇到过类似的问题。在尝试启动时我遇到了异常 app通过jnlp:

java.lang.NullPointerException
    at com.sun.javaws.JnlpxArgs.execProgram(Unknown Source)
    at com.sun.javaws.Launcher.relaunch(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.access$000(Unknown Source)
    at com.sun.javaws.Main$1.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source).

我的机器上有jdk 1.7以及JRE lib中的某些jar是如何丢失或损坏的。我有树脂安装JRE,它对我有用。我建议找出没有从jnlp文件中获取的jar并重新放置它们并查看它是否有效。