java - JNLP file auto update issue -


i have jws based application.
being deployed on web server , client downloads file browser , runs it.
creates desktop shortcut , applications runs perfectly.

now if change properties in jnlp file on server , run installed application ( on client machine ) desktop shortcut or downloaded jnlp file itself, it doesn't gets updated.

i have verified on jdk version 1_6_30 , 1_7_21. these 2 releases seems have resolved previous bug related whitespaces in cache path.
issue remains on windows xp/7/8.

original jnlp file :

<?xml version="1.0" encoding="utf-8"?> <jnlp codebase="path/to/filelocation" spec="1.0+" href="demo.jnlp" >  <information>  .  .  .  <offline-allowed/>   <shortcut online="false">           <desktop/>           <menu submenu="demo"/>   </shortcut> </information> <update check="always" policy="always"/> <!--request permissions application. not change--> <security>   <all-permissions/> </security> . . <resources> <!-- here referring wrapper feature since transitively refers other plug-ins  necessary --> <extension>      name="wrapper feature"     href="plugin_<some_random_generated_string_1>.jnlp"/> </extension> </resources> . . . <resources os="windows" arch="x86">          <j2se version="1.6+"  java-vm-args="-xms400m -xmx800m"/> </resources> 

updated jnlp file :

<?xml version="1.0" encoding="utf-8"?> <jnlp codebase="path/to/filelocation" spec="1.0+" href="demo.jnlp" >  <information>  .  .  .  <offline-allowed/>   <shortcut online="false">           <desktop/>           <menu submenu="demo"/>   </shortcut> </information> <update check="always" policy="always"/> <!--request permissions application. not change--> <security>   <all-permissions/> </security> . . <resources> <!-- here referring wrapper feature since transitively refers other plug-ins  necessary --> <extension>      name="wrapper feature"     href="plugin_<some_random_generated_string_2>.jnlp"/> </extension> </resources> . . <resources os="windows" arch="x86">           <j2se version="1.6+"  java-vm-args="-xms300m -xmx600m"/> </resources> 

change in java-vm-args not gets reflected.
update works if re-download jnlp file , run it. in case desktop shortcut still refers old 1 pain :(

verified jnlp using janela.

edit:

this demo.jnlp includes feature jnlp (added in blockquotes) includes required jars application. since on every update of application feature jnlp gets updated same not reflected on client.

jws has been @ updating jars, ..less when updating jnlp files themselves. dynamically generated jnlp typically lack href attribute indicate plug-in not create desktop shortcut.

on other hand work-around might found in integrationservice of jnlp api. might:

  1. cache copy of last known jnlp in persistenceservice.
  2. at app. start-up, connect server , explicitly read jnlp.
  3. compare cached version.
  4. if changed, uninstall desktop shortcut & relaunch app.
  5. if not changed, and no desktop shortcut exists, prompt install (new) desktop shortcut.

steps 2 & 3 might replaced simple check of headers url connection jnlp, if server returns valid 'last updated' time.


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -