我已经从Here下载了一个jnlp文件,并且在分析我得到的以下错误文件时,我已经从Here下载了JaNeLA。
这是文本报告
JaNeLA Report - version 11.05.17
Report for file:/C:/Documents%20and%20Settings/Administrator/Desktop/sample.jnlp
Content type application/xml does not equal expected type of application/x-java-jnlp-file
The element type "homepage" must be terminated by the matching end-tag "</homepage>".我知道错误是直截了当的,但我无法解决它们,并相信我已经尽了最大的努力。有人能帮上忙吗?
这是我的JNLP文件。
<?xml version="1.0" encoding="utf-8"?>
<!-- JNLP File for SwingSet2 Demo Application -->
<jnlp spec="6.0+" codebase="http://my_company.com/jaws/apps" href="swingset2.jnlp" >
<information>
<title>SwingSet2 Demo Application</title>
<vendor>Sun Microsystems, Inc.</vendor>
<homepage href="docs/help.html" />
<description>SwingSet2 Demo Application</description>
<description kind="short">A demo of the capabilities
of the Swing Graphical User Interface.</description>
<icon href="images/swingset2.jpg"/>
<icon kind="splash" href="images/splash.gif"/>
<offline-allowed/>
<association mime-type="application-x/swingset2-file" extensions="swingset2"/>
<shortcut online="false">
<desktop/>
<menu submenu="My Corporation Apps"/>
</shortcut>
</information>
<information os="linux">
<title> SwingSet2 Demo on Linux </title>
<homepage href="docs/linuxhelp.html">
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.6+" java-vm-args="-esa -Xnoclassgc"/>
<jar href="lib/SwingSet2.jar"/>
</resources>
<application-desc main-class="SwingSet2"/>
</jnlp> 发布于 2012-11-21 08:10:05
我想知道如何解决第一个问题
Content type application/xml does not equal expected type of application/x-java-jnlp-fileJaNeLA help建议:
应用程序的内容类型或MIME类型不是预期的类型。
JNLP
该JNLP的源代码是:
file:/C:/Documents%20and%20Settings/Administrator/Desktop/sample.jnlp..so您可以放心地忽略该警告。
其他问题
正如在评论中提到的那样。
<information os="linux">
<title> SwingSet2 Demo on Linux </title>
<homepage href="docs/linuxhelp.html">
</information>表示 homepage元素应以/结尾,如下所示:
<information os="linux">
<title> SwingSet2 Demo on Linux </title>
<homepage href="docs/linuxhelp.html"/>
</information>发布于 2012-11-21 08:12:17
而且,您没有关闭homepage标记。试试这个:
<homepage href="docs/linuxhelp.html"/>发布于 2013-11-24 01:14:31
第一个问题可以忽略。这是因为jnlp是从文件系统检索的,而不是从web服务器检索的。
JaNeLA help page这样说:
警告内容类型应用程序/xml不等于预期的应用程序类型/x-java-jnlp-file应用程序的内容类型或MIME类型不是预期的类型。
If this error is being returned from a real live server, it causes the client browser to simply display the content of the JNLP files as XML in the browser! Contact the server administraters to add the content-type.
It is typical for JNLP files checked from the local file system to be of incorrect type. https://stackoverflow.com/questions/13484009
复制相似问题