Search code examples
javajava-web-startjnlp

Java Web Start resource jar has future expires update check skipped


We have a big application, containing lots of jar-files, that recently has stopped to update itself. All the jar-files are signed by us. Often when we publish the application, it is only one jar-file that is updated, often the change is only a few bytes, and we do not use versioning on the jar-files (we may update this jar-file many times a day). Well, the web start has to reload the jar-files that are updated out of the many jar-files if it detects a new version, but lately it usually does not. We cannot ask the users to clear their cashe each time (which will load the newest jar-files), so I have to get to the bottom of this. I first started googling, and first added this line in my jnlp:

<update check="always" policy="always" />

This did NOT do the trick. However, I tried changing it to:

<update check="background" policy="always" />

This did give me some interesting finds. For each and every jar-file the console gives me the following line:

Resource (our website)/(our jar).jar has future expires: Sat Aug 02 11:01:08 CEST 2014 update check skipped.

So the jar files are skipped due to an "future expires" set to Sat Aug 02 11:01:08 for each and every file. (For the record, that is about one month into the future) Why is that? Where does this future expires date come from, and why does it break our web start application updates? And how do we fix it?


Solution

  • I finally found out that the trouble was that the web administrator had added some default cache headings on the web server to speed up web pages, but these were also then used for the jar-files. (He had added an ExpiresDefault "access plus 1 month") He removed the headers for jar-files/jnlp-files now, but the allready downloaded jar-files still had this expiresdefault-property. We therefore also had to add the following login-script for the users that log into our servers:

    IF EXIST %UserProfile%\javawsclearcache.txt (
        exit /B
    ) ELSE (
        echo. 2>%UserProfile%\javawsclearcache.txt
        javaws -uninstall
    )
    

    That takes care of most of the user base, but for the users that does not run the application from our own servers, well, luckily I will be on summer vacation soon, so there will not be a lot of updates this month, and from the second of august it will begin to update regularly for them too I guess...