views:

21

answers:

0

I am deploying an application using Java Web Start and would like to provide in-app notification of update availability.

I'm using DownloadService2 to check for update availability, but the return value is always an empty array.

I'm doing something like: {code}

Basic Service bs = (BasicService)ServiceManager.lookup("javax.jnlp.BasicService");
String loc = bs.getCodeBase().toString() + ".*";
DownloadService2 ds2 = (DownloadService2) ServiceManager.lookup("javax.jnlp.DownloadService2");
ResourceSpec results[] results = ds2.getUpdateAvailableResources(spec);

{code}

My jnlp (validated with JaNeLa) is something like: Title Vendor Description jnlp=MY.JNLP

Based on this enhancement list, I've set cache-control: no-cache for the application jar file: The "cache-control: no-cache" HTTP header is now supported. "no-cache" means cached contents cannot be used without re-validation. When the no-cache directive is used , an update check is always made to make sure the cached content is the same as the server copy pointed to, by the resource URL. If so, cached copy can be used. If not, server copy will be downloaded. Expiration field is ignored, which means that even if the cached resource is not expired yet, update check will still be performed.

My expectation is that this should cause DownloadService2 to make a request to my server to compare the timestamp of the local file to the timestamp of the server every time I call getUpdateAvailableResources, but based on tailing my server log, I know that it is not.

So, in a nutshell: I'm running my application via the .jnlp.
Then I'm redeploying my JWS application to my server - this updates the jar file.
Then I'm doing checking for updates using DownloadService2 as described above. The result of this check is an empty array, but I expect it to be a non-empty array.

Are my expectations for how this should work valid? Am I doing something wrong? Anything else I could try?

I'd prefer to use JWS classes to check for updates, but I'm leaning towards a custom solution since I haven't been able to get this to work.

I'd welcome any feedback, thank you!