JNLP无法解析启动文件。 行错误0(Jnlp Could not parse launch f

2019-09-29 10:27发布

我已经在网上搜索,并没有发现任何明确的解决办法,所以这里有云:

我做了一个JNLP文件在同一文件夹启动JAR,但它无法启动,并给出了错误“无法解析启动文件。行有错误0”。

这里的DevChat.jnlp:

<?xml version="1.0" encoding="utf-8"?> 
<!-- JNLP to Launch DevChat -->
<jnlp 
    spec="1.0+"
    href="DevChat.jnlp">

    <information>
        <title>DevChat</title>
        <vendor>Dev Team</vendor>
    </information>

    <security>
        <all-permissions/>
    </security>

    <resources>
    <j2se version="1.4.2"/>
        <jar href="DevSuite.jar" main="true" />
    <jar href="commons-net-3.0.1.jar" />
    </resources>

    <application-desc 
    main-class="DevChat"
        name="DevChat"
     </application-desc>

</jnlp>  

和异常:

JNLParseException[ Could not parse launch file. Error at line 0.]
at com.sun.javaws.jnl.XMLFormat.parse(Unknown Source)
at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(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)

而包装的异常:

java.lang.NullPointerException
at com.sun.deploy.xml.XMLParser.parseXMLAttribute(Unknown Source)
at com.sun.deploy.xml.XMLParser.parseXMLElement(Unknown Source)
at com.sun.deploy.xml.XMLParser.parseXMLElement(Unknown Source)
at com.sun.deploy.xml.XMLParser.parseXMLElement(Unknown Source)
at com.sun.deploy.xml.XMLParser.parseXMLElement(Unknown Source)
at com.sun.deploy.xml.XMLParser.parseXMLElement(Unknown Source)
at com.sun.deploy.xml.XMLParser.parse(Unknown Source)
at com.sun.javaws.jnl.XMLFormat.parse(Unknown Source)
at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(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)

从控制台运行表明,什么都没有。 任何帮助,将不胜感激!

Answer 1:

我想,这是XML格式不正确:

<application-desc 
    main-class="DevChat"
    name="DevChat"
</application-desc>

您需要关闭打开的标签是这样的:

<application-desc 
    main-class="DevChat"
    name="DevChat">
</application-desc>


文章来源: Jnlp Could not parse launch file. Error at line 0