2

JaNeLA というツールを使用して、アプリケーションの JNLP ファイルをチェックしています。

私のJNLPは次のとおりです。

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

以下について報告します。

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 コンテンツについて (赤で) レポートしている理由がわかりません。どんな助けでも大歓迎です。

4

1 に答える 1

1

この JNLP は、要素を正しい順序で配置します。上記で提案したように 、要素をドキュメントのさらに上に移動することで、両方の要素が修正されたことに注意してください。

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

もう 1 つの問題については、JNLP を変更し、現在のアプリを完全にアンインストールします。Java コントロール パネルを使用して、新しくロードします。

于 2013-07-10T18:52:13.850 に答える