首页 文章

启动文件中缺少以下必填字段:<jnlp>

提问于
浏览
1

我有一个包含applet的网页 . 这引用了一个JNLP文件 . 该网络应用程序由Tomcat提供服务 .

我已经使用JaNeLA验证了JNLP的有效性 . 为了在本地测试,我尝试将所有资源文件放在一个目录中并启动网页 - applet在浏览器中成功显示 .

但是,当尝试通过Tomcat提供网页时,我收到此错误

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

我怀疑没有找到JNLP文件,但是在尝试将它放在Tomcat webapps目录下的各个位置以及codebase参数的各种设置之后,仍然没有任何乐趣 .

这是我的JNLP文件

<?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>

这是我在HTML中的applet标记

<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>

编辑:我将JNLP以及我所有其他资源放在Apache Web服务器根目录中,并在我的jnlp_href属性中使用了一个URL -

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

我仍然不确定如何在Tomcat中部署它,但是现在上面解决了我的问题

1 回答

相关问题