Я использую Java WebStart с этим простым приложением, над которым я работаю, и я также сделал его так, чтобы он мог проверять наличие обновлений для последних версий файла JAR.Хотя при его запуске я получаю сообщение об ошибке, в котором говорится, что на сервере отсутствует ответ с отсутствующей версией.
ниже - мой код для файла 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)
Пожалуйста, посоветуйте, как поступить.Большое спасибо!