Search code examples
javajnlplaunchjava-web-start

Jnlp Could not parse launch file. Error at line 0


I have searched the web and have found no definitive solution, so here goes:

I made a JNLP file to launch a JAR in the same folder, however it fails to launch and gives the error "Could not parse launch file. Error at line 0."

Here's 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>  

And the exception:

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)

And the wrapped exception:

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)

Running from console shows nothing at all. Any help would be appreciated!


Solution

  • I guess that this XML is malformed:

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

    you need to close the open tag like this:

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