Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JNLP jar (re)download

858207Apr 27 2011
Hello All ,



I might be having a fundamental misconception here ; if so , please help me put it right.

I have a JNLP file which is automatically generated (automatic here actually indicates that a script will populate a particular field in the file (which holds references to some jar files). The rest of the file does not change)).

I am using the <version> attribute of the <jnlp> tag to indicate the version of the application.

My expectation is that each time this version attribute changes , the .jnlp file wlil be re-downloaded and also will be re-downloaded each of the jar files it references.

Below is a representative code sample :

<code>

<?xml version="1.0"; encoding="utf-8"?>



<jnlp

spec="1.0+";

codebase="$$codebase"

href="$$name"

version="%VERSION%">

<!-- version to be filled in by a script-->

<information>

.

. <!-- Some information here -->

.

</information>



<security><all-permissions/></security>



<resources>

<j2se version="1.6+"; initial-heap-size="32m" max-heap-size="512m" />

<jar href="my.jar";/>

<jar href="my2.jar";/>

<property name="property1" value="value1" />

<extension href="another.jnlp"; /> <!-- another .jnlp contains a list of jars that is generated by another script -->

</resources>





<application-desc main-class="my.main";/>



</jnlp>

</code>

The following scenario is what I am trying to implement :

a)Deploy the jnlp application on a server and access it by using http://localhost:XXXX/myapp

b)It downloads and installs and runs.

c)I close the app.

d)I now change one of the jar files referenced in another.jnlp and also some contents in my.jar and my2.jar.

e)I now repeat steps a) and b) (the .jnlp files "version" attributes are updated accordingly)



EXPECTATION : The jnlp file is re-downloaded and so are all the referenced jars[of particular interest my2.jar and any referenced jars in another.jnlp].

OBSERVATION : The jnlp file is re-downloaded but the OLD jars are still being used (I know its the old jars because I change something in the jar on the server and the change is not reflected in the client browser).



If I clear the java cache by doing a "javawas - uninstall" , I get the behaviour I seek in EXPECTATION ; however I do not want to clear the cache everytime I update some jar or other ; I want jnlp to detect that a jar has changed and re-download it.



How do I go about achieving this?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 25 2011
Added on Apr 27 2011
0 comments
440 views