12785

JNLP does not auto updating JAR file

Question:

I am working in a such environment, where we have to update client jar in every 2 months maximum. So, as a solution I am suggesting to use JNLP by using this approach we do not have to worry that every user is using the latest release or not. As, There are more then 100 clients per department.

But the problem is JNLP isn't upgrade the new jar file in the following is the my.jnlp file

<pre class="lang-xml prettyprint-override"><?xml version="1.0" encoding="utf-8"?> <jnlp spec="1.0+" codebase="http://192.168.1.26:8080/" href="Test.jnlp"> <information> <title>HC</title> <vendor>DRL</vendor> <homepage href="http://192.168.1.26:8080/" /> <description>DRL</description> <offline-allowed/> </information> <security> <all-permissions/> </security> <resources> <j2se version="1.6+" /> <jar href="JnlpTest.jar" download="eager" /> </resources> <application-desc name="HC-DRL" main-class="com.drl.simap.client.module.ui.Splash" /> </jnlp>

<strong>My working environment:</strong> Tomcat-6.0 server and following tutorial <a href="http://www.mkyong.com/java/java-web-start-jnlp-tutorial-unofficial-guide/" rel="nofollow">here</a>

Answer1:

If you download the jnlp <a href="http://jcp.org/aboutJava/communityprocess/mrel/jsr056/index5.html" rel="nofollow">spec</a> and look at chapter 6, there is a whole section about caching: "6 Downloading and Caching of Resources"

You can try to add a version number to your jar file and then use the jnlp jar version attribute.

If you currently don't do that, the spec states the following:

<blockquote>

An entry downloaded using the basic download protocol must be located in the cache based on the URL. The time stamp obtained from the HTTP GET request in the Last-Modified header field of the reply should be stored along with the downloaded resource. The time stamp is used to determine if the copy on the server is newer.

The JNLP Client cannot assume that the HTTP GET request will return the same JAR file for each request. The JNLP Client must periodically check the Web server to see if an updated version is available. This check is recommended to be performed before an application is launched, but the exact algorithm used by a JNLP Client depends on the particular implementation. For example, if a JNLP Client is offline, the check is not required to be performed.

The above caching rules also apply to extension descriptors downloaded using the extension download protocol where the version attribute is not specified.

</blockquote>

Recommend

  • Using the “extends” functionality in drools spreadsheets?
  • Drools - Grouping multiple dsl conditions in dslr's when part throws error
  • Multiple boolean conditions in a rule in drools?
  • Xcode 9 - Bluetooth module HC-06
  • How to write Drool rules in Excel sheet?
  • Apache HttpClient TCP Keep-Alive (socket keep-alive)
  • Error in bn.fit predict function in bnlear R
  • HUD layer not being added on my scene
  • Http request via one network interface
  • Communicate between asyncio protocol/servers
  • Maven: Command line to download the dependencies described in the pom.xml
  • MVC 3 - Editor template for List Model [closed]
  • Cluster markers with osmdroid
  • Is there a way to focus on a dynamically created form on Angular 4/Ionic3?
  • Git Configuration with eclipse--not able to push code from eclipse to remote git server
  • How can I associate a custom URL protocol with a ClickOnce app?
  • Open Graph Publish Using Spring Social
  • Can you use multiple instances of Edge on a Selenium Grid Node?
  • Grunt module(s) to upload all static assets to S3 / CloudFront, replace paths, and invalidate old as
  • cannot load gems in test environment
  • Soap Envelope Header in Delphi 7 not including utf-8 encoding. How can I modify it?
  • update record in database using jdatabase
  • Trouble connecting to Google Cloud SQL server from deployed app
  • Symfony2.1 form date field: Argument 1 passed to … must be an instance of DateTime
  • Eloquent Relationship on Partial Match
  • Install phpMongo Drivers on windows
  • Vigenere cipher not working
  • Pycharm: Marking a folder as 'sources root' is not recursive for subfolders
  • How can the INSERT … ON CONFLICT (id) DO UPDATE… syntax be used with a sequence ID?
  • QLPreviewController hide print button in ios6
  • MongoDB in PHP using aggregate to group by _id is null not working
  • Display issues when we change from one jquery mobile page to another in firefox
  • Uncaught Error: Could not find module `ember-load-initializers`
  • To display the title for the current loaction in map in iphone
  • bootstrap to use multiple ng-app
  • How to get icons for entities from eclipse?
  • How to include full .NET prerequisite for Wix Burn installer
  • trying to dynamically update Highchart column chart but series undefined
  • Turn off referential integrity in Derby? is it possible?
  • JaxB to read class hierarchy