我正在使用Java WebStart以及我正在使用的這個簡單應用程序,並且還使其能夠檢查最新版本的jar文件的更新。儘管在運行它時,我收到一條錯誤消息,指出服務器缺少版本響應。具有版本更新的Java WebStart
下面是我的JNLP文件代碼:
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+" codebase="http://localhost:8081/WebStartLauncher/app" href="Agecalc.jnlp">
<information>
<title>Jnlp Testing</title>
<vendor>Peter Ivan & co</vendor>
<homepage href="http://localhost:8081/WebStartLauncher" />
<description>Testing Testing</description>
<icon href="app/index.jpeg" kind="default"/>
<icon kind="shortcut" href="app/index.jpeg" width="32" height="32"/>
<offline-allowed/>
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.6+" />
<jar href="AgeCalc__V1.0.jar" version="1.0"/>
<jar href="AgeCalc__V1.1.jar" version="1.1"/>
<property name="jnlp.versionEnabled" value="true"/>
</resources>
<application-desc main-class="com.webstart.AgeCalculator" />
</jnlp>
爲version.xml:
<jnlp-versions>
<resource>
<pattern>
<name>AgeCalc__V1.0.jar</name>
<version-id>1.0</version-id>
</pattern>
<file>AgeCalc__V1.0.jar</file>
</resource>
</jnlp-versions>
的web.xml文件:
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>WebStartLauncher</display-name>
<welcome-file-list>
<welcome-file>webstart.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>JnlpDownloadServlet</servlet-name>
<servlet-class>jnlp.sample.servlet.JnlpDownloadServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>JnlpDownloadServlet</servlet-name>
<url-pattern>/WebContent/WEB-INF/lib</url-pattern>
</servlet-mapping>
</web-app>
而這些都是我得到的錯誤日誌:
com.sun.deploy.net.FailedDownloadException: Unable to load resource: (http://localhost:8081/WebStartLauncher/app/AgeCalc__V1.0.jar, 1.0)
at com.sun.deploy.net.DownloadEngine.actionDownload(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getResource(Unknown Source)
at com.sun.javaws.LaunchDownload.downloadJarFiles(Unknown Source)
at com.sun.javaws.LaunchDownload.downloadEagerorAll(Unknown Source)
at com.sun.javaws.Launcher.downloadResources(Unknown Source)
at com.sun.javaws.Launcher.prepareLaunchFile(Unknown Source)
at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
at com.sun.javaws.Launcher.launch(Unknown Source)
at com.sun.javaws.Main.launchApp(Unknown Source)
at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
at com.sun.javaws.Main$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.io.IOException: missing version response from server
at com.sun.deploy.net.DownloadEngine.actionDownload(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getResource(Unknown Source)
at com.sun.javaws.LaunchDownload.downloadJarFiles(Unknown Source)
at com.sun.javaws.LaunchDownload.downloadEagerorAll(Unknown Source)
at com.sun.javaws.Launcher.downloadResources(Unknown Source)
at com.sun.javaws.Launcher.prepareLaunchFile(Unknown Source)
at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
at com.sun.javaws.Launcher.launch(Unknown Source)
at com.sun.javaws.Main.launchApp(Unknown Source)
at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
at com.sun.javaws.Main$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
請告知如何繼續。非常感謝!