Hi,
I'm having such a problem that changes made to the JNLP file at the server aren't updated to the JNLP file at the client if the application is started from a desktop shortcut. In my actual application I experienced this when adding a jar library to the application distributed over HTTP but I have produced the following example where the codebase of a JNLP application (distributed over local file system) is changed.
Overall:
In my example, I am using the Dynamic Tree demo jar from [url http://download.oracle.com/javase/tutorial/deployment/webstart/deploying.html]Deploying a Java Web Start Application ->[url http://download.oracle.com/javase/tutorialJWS/deployment/webstart/ex6/webstart_ComponentArch_DynamicTreeDemo/DynamicTreeDemo.jar]DynamicTreeDemo.jar. The evaluation is done with java 6u26 at Windows XP.
The steps
<li> 1. Have a JNLP file with jar used (in my example at
D:\jnlp-test )
<li> 2. Start the application from the JNLP file (allow creating desktop shortcut)
<li> 3. Modify the JNLP file.
<li> - In my example, update the codebase to
D:\jnlp-test2. Also copy the JNLP and the jar to that directory.
<li> 4. Run the application from the desktop shortcut
<li> - 4.1 - at this phase the JNLP file at the cache should be updated
<li> 5. Remote the directory
D:\jnlp-test
Results
a) After step 4 I expect that the cached JNLP application (viewer from Control Panel -> Java -> ...) should be updated to contain the new content (new codebase). BUT my cached JNLP file still contains the old content (at my example codebase="file:/D:/jnlp-test/")
b) At step 5 my application should work fine from the new distribution location BUT The problem crashes while trying to access the old location with:
Unable to launch the application
Error: D:\jnlp-test\DynamicTreeDemo.jar (Määritettyä polkua ei löydy) +("The path can't be found" in Finnish)+
My original JNLP file (steps 1 & 2):
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.6+"
codebase="file:/D:/jnlp-test/"
href="dynamictree-webstart.jnlp">
<information>
<title>Dynamic Tree Demo</title>
<vendor>Dynamic Team</vendor>
<shortcut online="true">
<desktop/>
</shortcut>
</information>
<resources>
<!-- Application Resources -->
<j2se version="1.6+"
href="http://java.sun.com/products/autodl/j2se"/>
<jar href="DynamicTreeDemo.jar" main="true" />
</resources>
<application-desc
main-class="webstartComponentArch.DynamicTreeApplication">
</application-desc>
</jnlp>
The modified JNLP file (after step 3, codebase changed)
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.6+"
codebase="file:/D:/jnlp-test2/"
href="dynamictree-webstart.jnlp">
<information>
<title>Dynamic Tree Demo</title>
<vendor>Dynamic Team</vendor>
<shortcut online="true">
<desktop/>
</shortcut>
</information>
<resources>
<!-- Application Resources -->
<j2se version="1.6+"
href="http://java.sun.com/products/autodl/j2se"/>
<jar href="DynamicTreeDemo.jar" main="true" />
</resources>
<application-desc
main-class="webstartComponentArch.DynamicTreeApplication">
</application-desc>
</jnlp>
What could be wrong with my JNLP files or is there a bug? [url http://www.coderanch.com/t/528570/JNLP-Web-Start/java/Do-jnlp-file-updates-itself#2455103] Coderanch thread Do jnlp file updates itself discusses something similar that happens only when Java Web Start cache path contains whitespace?
Best regards,
Touko
Edited by: user603338 on Aug 9, 2011 12:06 AM (Fixed the Coderanch link)