v1.5 app fails with "Cannot find cached resource" in v1.6
After upgrading to v1.6 my application cannot start (after importing the jar files manually into the cache).
Unable to launch application
Error: Cannot find cached resource for URL:http:/server/jar1.jar
The application is supposed to run online as well as offline.
When running online I want the jws cache to be updated with the server version of the application.
Since it must also run offline, I import the jar files to the jws cache during installation of the application.
Using JRE 1.5 everything works fine. I import the jar files using:
javaws -import -silent -codebase "file:/c:\my-java-code" "file:/c:\my-java-code\my-app.jnlp"
and I can start the application by the command line:
javaws C:\my-java-code\my-app.jnlp
If there is no connection to the server, the application starts in offline mode.
If the server is available, the new server-side version of my-app is downloaded and started.
Unfortunately this does not work with jre/jws 1.6
If there is no connection to the server, the application from cache starts up fine.
If the server is available, jws downloads the newer version but fails with:
Unable to launch application
Error: Cannot find cached resource for URL:http:/server/jar1.jar
The only workaround I can find is by creating a copy of the jnlp file where I add 'version="+"' to each <jar> tag.
If I import this one:
javaws -import -silent -codebase "file:/c:\my-java-code" "file:/c:\my-java-code\my-app-INSTALL.jnlp"
I can start the application using the original jnlp file:
javaws C:\my-java-code\my-app.jnlp
my-app-INSTALL.jnlp still references my-app.jnlp in the <jnlp> tag.
Unfortunately this does not work with jre/jws 1.5.
I am also uncomfortable using this approach since I don't know why it works :-)
Any ideas of what is going on here and a safe solution that works for both 1.5 and 1.6 (at least for 1.6 and upcoming releases)?
my-app.jnpl (superfluous info removed)
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.5" codebase="http://server" href="my-app.jnlp">
<information>
<offline-allowed/>
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se max-heap-size="512m" version="1.5+"/>
<jar href="jar1.jar" main="true"/>
<jar href="jar2.jar"/>
</resources>
<application-desc main-class="app.MainEntryPoint">
<argument>arg1</argument>
<argument>arg2</argument>
</application-desc>
</jnlp>
my-app-INSTALL.jnpl (superfluous info removed)
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.5" codebase="http://server" href="my-app.jnlp">
<information>
<offline-allowed/>
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se max-heap-size="512m" version="1.5+"/>
<jar href="jar1.jar" main="true" version="+"/>
<jar href="jar2.jar" version="+"/>
</resources>
<application-desc main-class="app.MainEntryPoint">
<argument>arg1</argument>
<argument>arg2</argument>
</application-desc>
</jnlp>

