在部署期间,我们使用JNLP的基于JavaFX的应用程序发现了非常奇怪的事情。
同时,普通的http工作完美。在意识到这种奇怪的行为后,我在java控制台中启用了详细的日志记录,并找到了两种不同的方法,我无法解释。
对于https版本,javaws将jnlp中的URI转换为带有file:// prefix
的本地有界链接<jnlp spec="6.0+" codebase="file:/var/tmp/" href="file:/var/tmp/sniper-client.jnlp">
<information>
<title>MyApp</title>
<vendor>MyCompany</vendor>
<homepage href="null"/>
<description>MyApp</description>
<offline-allowed/>
</information>
<security>
<all-permissions/>
</security>
<update check="background" policy="always"/>
<resources>
<javafx-runtime version="2.2+" href="http://javadl.sun.com/webapps/download/GetFile/javafx-latest/windows-i586/javafx2.jnlp"/>
<java java-vm-args="-Djava.net.preferIPv4Stack=true" href="http://java.sun.com/products/autodl/j2se" version="1.6.0+"/>
<jar href="file:/var/tmp/myapp.jar" download="eager" main="false"/>
<jar href="file:/var/tmp/lib/afterburner.fx-1.5.1.jar" download="eager" main="false"/>
<jar href="file:/var/tmp/lib/commons-math3-3.3.jar" download="eager" main="false"/>
<jar href="file:/var/tmp/lib/gson-2.2.4.jar" download="eager" main="false"/>
<jar href="file:/var/tmp/lib/joda-time-2.3.jar" download="eager" main="false"/>
<jar href="file:/var/tmp/lib/logback-classic-1.1.0.jar" download="eager" main="false"/>
<jar href="file:/var/tmp/lib/logback-core-1.1.0.jar" download="eager" main="false"/>
但是对于普通的http,所有链接都被正确转换为http绑定的URL:
<jnlp spec="6.0+" codebase="http://server:9800/client/" href="http://server:9800/client/myapp.jnlp">
<information>
<title>MyApp</title>
<vendor>MyCompany</vendor>
<homepage href="null"/>
<description>MyApp</description>
<offline-allowed/>
</information>
<security>
<all-permissions/>
</security>
<update check="background" policy="always"/>
<resources>
<javafx-runtime version="2.2+" href="http://javadl.sun.com/webapps/download/GetFile/javafx-latest/windows-i586/javafx2.jnlp"/>
<java java-vm-args="-Djava.net.preferIPv4Stack=true" href="http://java.sun.com/products/autodl/j2se" version="1.6.0+"/>
<jar href="http://server:9800/client/myapp.jar" download="eager" main="false"/>
<jar href="http://server:9800/client/lib/afterburner.fx-1.5.1.jar" download="eager" main="false"/>
<jar href="http://server:9800/client/lib/commons-math3-3.3.jar" download="eager" main="false"/>
<jar href="http://server:9800/client/lib/gson-2.2.4.jar" download="eager" main="false"/>
问题是如何使这个应用程序在https上运行?