Andrew Fielden
Andrew Fielden

Reputation: 3899

The following required field is missing from the launch file: <jnlp>

I have a web page containing an applet. This references a JNLP file. The web app is served by Tomcat.

I've verified that the JNLP is valid using JaNeLA. To test this locally, I tried putting all the resource files in one directory and launching the web page - applet was displayed successfully in the browser.

However when trying to serve up the web page via Tomcat I get this error

The following required field is missing from the launch file: <jnlp>

I suspect that the JNLP file is not being found, but after trying to place it within various locations under the Tomcat webapps directory, and various settings of the codebase parameter, still no joy.

Here's my JNLP file

<?xml version="1.0" encoding="utf-8"?>

   <jnlp href="WWJApplet.jnlp">
    <information>
        <title>World Wind Java Applet Demo</title>
        <vendor>NASA</vendor>
        <homepage href="http://worldwind.arc.nasa.gov"/>
        <description>World Wind Java Applet Demo</description>
        <description kind="short">World Wind Java Applet Demo</description>
        <offline-allowed/>
    </information>
    <security>
        <all-permissions/>
    </security>
     <resources os="Windows">
       <property name="sun.java2d.noddraw" value="true"/>
     </resources>
     <resources>
        <!--property name="sun.java2d.noddraw" value="true"/-->
        <java version="1.5+"/>
        <j2se href="http://java.sun.com/products/autodl/j2se" version="1.5+" initial-heap-size="512m" max-heap-size="512m"/>
        <jar href="mapviewapplet.jar" main="true"/>
        <!--jar href="WWJApplet.jar" main="true"/-->
        <jar href="worldwind.jar"/>
        <jar href="httpclient-4.0.1.jar"/>
        <jar href="httpcore-4.0.1.jar"/>
        <extension name="jogl"
                   href="http://download.java.net/media/jogl/builds/archive/jsr-231-webstart-current/jogl.jnlp"/>
     </resources>
     <!-- Width and heigth are overwritten by the surrounding web page -->
     <applet-desc
         name="WWJ Applet"
         main-class="com.pwr.mapviewer.ui.MapApplet"
         width="800" height="600">
        <param name="separate_jvm" value="true" />
     </applet-desc>
   </jnlp>

Here is my applet tag within the HTML

    <applet 
          code="org.jdesktop.applet.util.JNLPAppletLauncher" 
          width=600
          height=400
          archive="mapviewapplet.jar,
                   jogl.jar,
                   gluegen-rt.jar,
                   worldwind.jar">
           <param name="jnlp_href" value="WWJApplet.jnlp"/> <!-- Picked up by new plugin -->
           <param name="codebase_lookup" value="false"/>
           <param name="subapplet.classname" value="com.pwr.mapviewer.ui.MapApplet"/>
           <param name="subapplet.displayname" value="World Wind Applet"/>
           <param name="noddraw.check" value="true"/>
           <param name="progressbar" value="true"/>
           <param name="jnlpNumExtensions" value="1"/>

     </applet>

Edit: I placed the JNLP, along with all my other resources in the Apache web server root directory, and used a URL in my jnlp_href attribute -

<param name="jnlp_href" value="http://localhost:80/WWJApplet.jnlp"/>

I'm still not sure how this should be deployed within Tomcat, but for now the above resolves my problem

Upvotes: 1

Views: 6192

Answers (1)

Harald
Harald

Reputation: 11

Not sure what you mean by "picked up by new plugin" in your HTML. However, according to http://download.oracle.com/javase/tutorial/deployment/applet/html.html, the JNLP file should be referenced by the "jnlp_ref" attribute within the applet tag.

Upvotes: 1

Related Questions