Java Webstart intermittant JAR not updating
Asked Answered
H

8

12

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>
Heppman answered 27/1, 2010 at 16:14 Comment(0)
S
5

You might have solved the issue - But jnlp spec="1.0+" - The element is supported only after jnlp spec 6.0+. Probably thats is one of the reasons for your updates failing.

Skimpy answered 14/1, 2011 at 16:47 Comment(0)
P
1

Assuming the client JREs are up to date, you might try <update check="timeout" policy="always"/> as suggested in this thread and described in the JNLP syntax documentation.

Paulownia answered 27/1, 2010 at 20:6 Comment(2)
@trashgod, you'll notice I already have <update check="always" policy="always"/> in the code.Heppman
Yes, but the intermittent nature of the problem does not rule out Telcontar's hypothesis. I can't help wondering if "timeout" or even "background" might allow the update to succeed. I also recall having to touch the .jnlp file itself when switching to a new certificate.Paulownia
D
1

I had the same issues as yours and solved it by doing the following:

  1. Change

    <jar href="OurUpdatedJarName.jar" ...

    to

    <jar href="OurUpdatedJarName-$VERSION.jar" ...

  2. Put $VERSION into the <a href="foo-$VERSION.jnlp">Run</a>

We automatically update $VERSION for every deployment.

I know it's an ugly solution but it's one that works for us everytime.

Diep answered 29/11, 2010 at 15:46 Comment(1)
This looks like you aren't using the more standard (according to spec)... __V{version}.jar and using JWS versionEnabled flag?Ratliff
I
1

Might be related to this post, http://www.coderanch.com/t/528570/JNLP-Web-Start/java/Do-jnlp-file-updates-itself

Ingratitude answered 14/7, 2011 at 3:3 Comment(0)
E
1

this problem is caused by offline-allowed tag.

Per JNLP spec

If offline-allowed is specified, Java Web Start will also check to see if an update is available. However, if the application is already downloaded the check will timeout after a few seconds, in which case the cached application will be launched instead. Given a reasonably fast server connection, the latest version of the application will usually be run, but it is not guaranteed. The application, however, can be run offline.

Entellus answered 22/2, 2013 at 2:2 Comment(0)
P
0

we have distributed java web start applications over a dozen countries and when we have found that the application wasn't updating correctly it was for a miss-configuration of the county net, or in the network settings of user computer, mostly the proxy. In our central officines in spain java web start allways work ok.

Pollard answered 27/1, 2010 at 16:50 Comment(1)
Hi Telcontar, yes, however with no configuration changes this works intermittantly.. so it is unlikely a network problem unless it has something to do with proxy cache, but then, when deleting the webstart cache it would not fix the problem.Heppman
I
0

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.

Irrelative answered 1/9, 2014 at 4:52 Comment(0)
I
0

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.

Icj answered 5/2, 2015 at 0:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.