我正在尝试在网络服务器上部署应用程序并在启动它时遇到问题。它正确加载 GUI,但对事件没有反应。这是控制台日志:
basic: JNLP2ClassLoader.findClass: java.lang.AnchorPane: try again ..
basic: JNLP2ClassLoader.findClass: java.lang.AnchorPane: try again ..
basic: JNLP2ClassLoader.findClass: java.util.AnchorPane: try again ..
basic: JNLP2ClassLoader.findClass: java.util.AnchorPane: try again ..
等等。我用谷歌搜索,发现 JNLP 文件是错误的。我和JaNeLa核对了一下,发现它实际上是错误的。贾奈拉日志:
cvc-complex-type.2.4.a: Invalid content was found starting with element 'jfx:javafx-runtime'. One of '{java, j2se, jar, nativelib, extension, property, package}' is expected.
cvc-complex-type.2.4.a: Invalid content was found starting with element 'jfx:javafx-runtime'. One of '{java, j2se, jar, nativelib, extension, property, package}' is expected.
cvc-complex-type.2.4.a: Invalid content was found starting with element 'security'. One of '{resources, application-desc, applet-desc, component-desc, installer-desc}' is expected.
cvc-complex-type.2.4.a: Invalid content was found starting with element 'security'. One of '{resources, application-desc, applet-desc, component-desc, installer-desc}' is expected.
之后我google了很多,发现了很多类似的问题,但没有解决方案。请帮忙!这是我的JNLP文件。
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0" xmlns:jfx="http://javafx.com" href="JavaFXApplication1.jnlp">
<information>
<title>JavaFXApplication1</title>
<vendor>miceZipper</vendor>
<description>Sample JavaFX 2.0 application.</description>
<offline-allowed/>
</information>
<resources>
<jfx:javafx-runtime version="2.2+" href="http://javadl.sun.com/webapps/download/GetFile/javafx-latest/windows-i586/javafx2.jnlp"/>
</resources>
<resources>
<j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se"/>
<jar href="JavaFXApplication1.jar" size="25531" download="eager" />
</resources>
<security>
<all-permissions/>
</security>
<applet-desc width="800" height="600" main-class="com.javafx.main.NoJavaFXFallback" name="JavaFXApplication1" >
<param name="requiredFXVersion" value="2.2+"/>
</applet-desc>
<jfx:javafx-desc width="800" height="600" main-class="javafxapplication1.JavaFXApplication1" name="JavaFXApplication1" />
<update check="always"/>
</jnlp>