首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >JaNeLA报告有关有效JNLP的错误

JaNeLA报告有关有效JNLP的错误
EN

Stack Overflow用户
提问于 2013-07-11 02:20:35
回答 1查看 1.1K关注 0票数 2

我使用一个名为JaNeLA的工具来检查我的应用程序的JNLP文件。

我的JNLP是:

代码语言:javascript
复制
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="6.0+" xmlns:jfx="http://javafx.com" codebase="http://myserver.com/downloads">
  <information>
    <title>My App</title>
    <vendor>My Vendor</vendor>
    <description>Application to do something</description>
    <homepage href="http://myserver.com/myapp" />
    <offline-allowed/>
    <shortcut online="true">
      <desktop/>
      <menu submenu="My App"/>
    </shortcut>
  </information>

  <security>
    <all-permissions/>
  </security>

  <resources>
    <j2se version="1.7.0_25" java-vm-args="-Xmx1024m -Djava.net.preferIPv4Stack=true"    href="http://java.sun.com/products/autodl/j2se"/>
    <property name="myID" value="1" /> 
  </resources>

  <resources os="Windows" arch="x86">
    <jar href="my-app-0.0.1.jar" download="eager" />
  </resources>

  <resources os="Windows" arch="amd64">
    <jar href="map-app-0.0.1.jar" download="eager" />
  </resources>

  <application-desc main-class="com.myApp.MyApp"/>

  <update check="always"/>

</jnlp>

它报告了以下内容:

代码语言:javascript
复制
JaNeLA Report - version 11.05.17


Report for file:/C:/Users/Desktop/myapp.jnlp

Content type application/xml does not equal expected type of application/x-java-jnlp-file
cvc-complex-type.2.4.a: Invalid content was found starting with element 'homepage'. One of '{description, icon, offline-allowed, shortcut, association, related-content}' is expected.
cvc-complex-type.2.4.a: Invalid content was found starting with element 'homepage'. One of '{description, icon, offline-allowed, shortcut, association, related-content}' is expected.
cvc-complex-type.2.4.d: Invalid content was found starting with element 'update'. No child element is expected at this point.
cvc-complex-type.2.4.d: Invalid content was found starting with element 'update'. No child element is expected at this point.
XML encoding not known, but declared as utf-8
Codebase + href 'http://myserver.com/C:/Users/Desktop/myapp.jnlp' is not equal to actual location of 'file:/C:/Users/Desktop/myapp.jnlp'.
Desktop icons were subject to bug nnnn in earlier J2SE versions
Downloads can be optimized by specifying a resource size for 'myapp-0.0.1.jar'.
The resource download at myapp-0.0.1.jar can be optimized by removing the (default) value of download='eager'.
The resource download at myapp-0.0.1.jar can be optimized by removing the (default) value of main='false'.
It might be possible to optimize the start-up of the app. by  specifying download='lazy' for the myapp-0.0.1.jar resource.
Lazy downloads might not work as expected for myapp-0.0.1.jar unless the download 'part' is specified. 
Downloads can be optimized by specifying a resource size for 'myapp-0.0.1.jar'.
The resource download at myapp-0.0.1.jar can be optimized by removing the (default) value of download='eager'.
The resource download at myapp-0.0.1.jar can be optimized by removing the (default) value of main='false'.
It might be possible to optimize the start-up of the app. by  specifying download='lazy' for the myapp-0.0.1.jar resource.
Lazy downloads might not work as expected for myapp-0.0.1.jar unless the download 'part' is specified. 

我不确定的是,JaNeLA报告存在无效内容,即Invalid content was found starting with element 'homepage'. One of '{description, icon, offline-allowed, shortcut, association, related-content}' is expected.在上面的JNLP中满足了这个条件。

此外,它报告了关于Invalid content was found starting with element 'update'. No child element is expected at this point.的这个条件也满足了我所看到的。

不确定为什么它报告(红色)有效的JNLP内容。任何帮助都将不胜感激。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-07-11 02:52:14

这个JNLP以正确的顺序放置元素。请注意,这两个元素都是通过在文档中进一步向上移动元素来修复的-就像我上面建议的那样。

代码语言:javascript
复制
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="6.0+" xmlns:jfx="http://javafx.com" codebase="http://myserver.com/downloads">
  <information>
    <title>My App</title>
    <vendor>My Vendor</vendor>
    <homepage href="http://myserver.com/myapp" />
    <description>Application to do something</description>
    <offline-allowed/>
    <shortcut online="true">
      <desktop/>
      <menu submenu="My App"/>
    </shortcut>
  </information>
  <security>
    <all-permissions/>
  </security>
  <update check="always"/>
  <resources>
    <j2se version="1.7.0_25" java-vm-args="-Xmx1024m -Djava.net.preferIPv4Stack=true"    href="http://java.sun.com/products/autodl/j2se"/>
    <property name="myID" value="1" /> 
  </resources>
  <resources os="Windows" arch="x86">
    <jar href="my-app-0.0.1.jar" download="eager" />
  </resources>
  <resources os="Windows" arch="amd64">
    <jar href="map-app-0.0.1.jar" download="eager" />
  </resources>
  <application-desc main-class="com.myApp.MyApp"/>
</jnlp>

对于另一个问题,更改JNLP,完全卸载当前应用程序。使用Java控制面板,并重新加载它。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/17578061

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档