Documentation

The Java™ Tutorials
Hide TOC
Common Java Web Start Problems常见的Java Web启动问题
Trail: Deployment
Lesson: Java Web Start

Common Java Web Start Problems常见的Java Web启动问题

This section covers some common problems that you might encounter when developing and deploying Java Web Start applications. 本节介绍在开发和部署Java Web Start应用程序时可能遇到的一些常见问题。After each problem is a list of possible reasons and solutions.在每个问题之后都列出了可能的原因和解决方案。

Problem: My browser shows the Java Network Launch Protocol (JNLP) file for my application as plain text.我的浏览器将我的应用程序的Java网络启动协议(JNLP)文件显示为纯文本。

Most likely, your web server is not aware of the proper MIME type for JNLP files. 很可能,您的web服务器不知道JNLP文件的正确MIME类型。See the Setting up the web server section for more information.

Furthermore, if you are using a proxy server, ensure that the update versions of the files are returned, by updating the time stamp of the resources on the web server such that the proxies will update their caches.此外,如果您使用的是代理服务器,请确保返回文件的更新版本,方法是更新web服务器上资源的时间戳,以便代理更新其缓存。

Problem: When I try to launch my JNLP file, I get the following error:当我尝试启动JNLP文件时,出现以下错误:

MissingFieldException[ The following required field is missing from the launch
  file: (<application-desc>|<applet-desc>|<installer-desc>|<component-desc>)]
        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.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

Often this error occurs when your XML is malformed. 当XML格式不正确时,通常会发生此错误。You can stare at the code until you figure it out but it is easier to run an XML syntax checker over the file. 您可以一直盯着代码看,直到弄明白为止,但在文件上运行XML语法检查器更容易。(NetBeans IDE and jEdit both provide XML syntax checkers.)(NetBeans IDE和jEdit都提供XML语法检查器。)

However, this error can occur in a other situations and the above was caused by the following line in an otherwise well-formed XML file:但是,在其他情况下可能会发生此错误,上述错误是由格式良好的XML文件中的以下行引起的:

<description kind="short">Demonstrates choosing the drop location in the target <code>TransferHandler</code></description>

The error was caused by the illegal embedded code tags.错误是由非法嵌入的code标记引起的。


Previous page: Java Web Start and Security
Next page: Questions and Exercises: Java Web Start