Skip to main content

With Java 8 the old JNLP is being used by the Java cache even if the JNLP codebase is updated

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
1 reply [Last post]
anura1
Offline
Joined: 2013-03-06

FULL PRODUCT VERSION :
java version "1.8.0-ea"
Java(TM) SE Runtime Environment (build 1.8.0-ea-b79)
Java HotSpot(TM) Client VM (build 25.0-b20, mixed mode)

ADDITIONAL OS INFORMATION:
Microsoft Windows XP Professional Service Pack 3

DESCRIPTION OF THE PROBLEM :
The old JNLP is being used by the Java cache even if the JNLP codebase is updated.

Steps to reproduce:

1. Have a JNLP calling a jar file (with codebase as C:\MyApplication containing the jar file)
2. Start the application using the JNLP file.
3. Modify the JNLP to update codebase as C:\MyApplication2. Also copy the jar file to that directory.
4. Run the application again from the modified JNLP file.

EXPECTED BEHAVIOR VS ACTUAL BEHAVIOUR:
The cached JNLP application should be updated with the new codebase(i.e. C:\MyApplication2) and the same should be used for running the jar file. - EXPECTED
But the cached JNLP still contains the old codebase(i.e. C:\MyApplication) and the program crashes while trying to access the jar in old location if the jar becomes unavailable. - ACTUAL

ERROR MESSAGES/STACK TRACES THAT OCCUR :
Unable to launch the application

java.lang.ClassNotFoundException: TestMain
at java.net.URLClassLoader$1.run(URLClassLoader.java:359)
at java.net.URLClassLoader$1.run(URLClassLoader.java:348)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:347)
at com.sun.jnlp.JNLPClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
at java.lang.Thread.run(Thread.java:722)

REPRODUCIBILITY :
This bug is always reproducible.

---------- BEGIN SOURCE ----------

My original JNLP file (step 1 & 2):

<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="6.0+" codebase="file:///C:\MyApplication" href="file:///C:\Documents and Settings\user\app.jnlp">
  <information>
    <title>My First Application</title>
    <vendor>Application Vendor</vendor>
    <offline-allowed/>
  </information>
  <security>
    <all-permissions/>
  </security>
  <update check="always" policy="always"/>
  <resources>
    <j2se version="1.6+"/>
    <jar href="Common.jar"/>
  </resources>
  <application-desc main-class="TestMain"/>
</jnlp>

My modified JNLP file (step 3, codebase changed):

<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="6.0+" codebase="file:///C:\MyApplication2" href="file:///C:\Documents and Settings\user\app.jnlp">
  <information>
    <title>My First Application</title>
    <vendor>Application Vendor</vendor>
    <offline-allowed/>
  </information>
  <security>
    <all-permissions/>
  </security>
  <update check="always" policy="always"/>
  <resources>
    <j2se version="1.6+"/>
    <jar href="Common.jar"/>
  </resources>
  <application-desc main-class="TestMain"/>
</jnlp>

---------- END SOURCE ----------

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
robilad
Offline
Joined: 2004-05-05

Please file a bug report at http://bugs.sun.com/services/bugreport/index.jsp

Dalibor Topic
Principal Product Manager
Java Platform Group @ Oracle