We use java Webstart to deploy a java application on our intranet. The application receives frequent updates. Once in awhile a user will launch the application from their desktop icon after we have updated the JARs / WAR on the webserver (timestamp changed) and Java Webstart will launch the old version instead of downloading a new one.
Here is a paste of our JNLP, as you can see offline-allowed is on, but update check always and policy always. Also, download flag is eager. From my understanding these options should always result in a check of cache against timestamp on server and a download of the JAR file.
I'm starting to get frustrated with Webstart! Has anyone seen similiar problems? Any solutions? I'm getting sick of walking people through clearing their webstart cache manually every third or fifth update.
<?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>
I had this problem just because I didn't let the app opened time enough to complete the update.
If you have this option: update check="background" in your JNLP, wait some time before close the application in order to allow the update (that is running on background) finish.
I've been using the java webstart nextx.jar clone. I traced my not updating JAR issue to the use of the URLConnection.getLastUpdated() method. Since it uses the HEAD method to get the lastUpdated of the filename, this is the reason why sometimes it does not download due to caching of the getLastUpdated(). We decided to use our own method of refreshing our application as webstart is flawed.