我们使用 java Webstart 在我们的内部网上部署一个 java 应用程序。该应用程序接收频繁更新。在我们更新网络服务器上的 JAR/WAR(时间戳已更改)后,用户有时会从他们的桌面图标启动应用程序,并且 Java Webstart 将启动旧版本而不是下载新版本。
这是我们的 JNLP 的粘贴,您可以看到允许离线,但始终更新检查和策略。此外,下载标志是急切的。根据我的理解,这些选项应该始终导致根据服务器上的时间戳检查缓存并下载 JAR 文件。
我开始对 Webstart 感到沮丧!有没有人见过类似的问题?任何解决方案?每三次或五次更新时,我都厌倦了让人们手动清除他们的 webstart 缓存。
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE jnlp PUBLIC "-//Sun Microsystems, Inc//DTD JNLP Descriptor 6.0//EN" "http://java.sun.com/dtd/JNLP-6.0.dtd">
<jnlp spec="1.0+" codebase="$$codebase" href="$$name">
<information>
<title>TITLE</title>
<vendor>VENDOR</vendor>
<description>Our Utility Application</description>
<description kind="short">Our Utility Application PRD</description>
<icon href="images/util_icon.png" height="64" width="64"/>
<offline-allowed/>
<shortcut online="true">
<desktop />
<menu submenu="Utility Apps"/>
</shortcut>
</information>
<security>
<all-permissions />
</security>
<update check="always" policy="always" />
<resources>
<!-- requires 1.6+ -->
<j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se" java-vm-args="-ea" initial-heap-size="128m" max-heap-size="512m" />
<!-- application code, download jar before we start. -->
<jar href="OurUpdatedJarName.jar" main="true" download="eager" />
<property name="configfile" value="updatedJarName.config" />
</resources>
<application-desc main-class="main.Client">
<argument>-D</argument>
</application-desc>
</jnlp>
最佳答案
您可能已经解决了这个问题 - 但是 jnlp spec="1.0+"- 只有在 jnlp spec 6.0+ 之后才支持该元素。这可能是您更新失败的原因之一。
关于Java Web Start 间歇性 JAR 不更新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2148454/