This discussion is archived
3 Replies Latest reply: Dec 16, 2012 9:47 PM by 950421 RSS

Java7, cannot clear the JNLP cache of dynamically generated JNLP.

950421 Newbie
Currently Being Moderated
Hello,

I use the dynamically generated JNLP to launch a webstart application(JavaFX application) so that I can passed the session info(userid,JESSIONID...etc) to the application, and the application will perform an clean up of JNLP cache after launched use the DownLoadService(in jnlp.jar). As actually there's no JNLP file exist in server side, I use the Main JAR file path plus "jnlp" as the JNLP URL, the code like this:
----
DownloadService ds;
try {
ds = (DownloadService)ServiceManager.lookup("javax.jnlp.DownloadService");
} catch (UnavailableServiceException e) {
ds = null;
}

if (ds != null) {
try {
URL url = new URL("http://192.168.18.35:8088/joffice/webstart/Win2Erp.jarjnlp");
boolean cached = ds.isResourceCached(url, null);
if (cached) {
ds.removeResource(url, null);
}
......
----
It works fine in JAVA6, but it cannot work in JAVA7(I have tested it with JAVA7u12). In log window I can see the webstart use the cache of JNLP of last time to launch my application, it leads to the application fails to login unless manually clear the local cache of application.

Many thanks in advance for any response!

Edited by: GrealeGe on 2012-12-8 δΈ‹εˆ5:09
  • 1. Re: Java7, cannot clear the JNLP cache of dynamically generated JNLP.
    950421 Newbie
    Currently Being Moderated
    Here is the java console log shows what happended:
    -----
    JNLP Ref (absolute): http://192.168.18.35:8088/joffice/webstart/startfx.jsp?JSESSIONID=7F2166F960AD42A3A0552488B580F8A5
    basic: new Launcher:
    <jnlp spec="1.0" codebase="http://192.168.18.35:8088/joffice/webstart/" version="1.3">
    <information>
    <title>Mutual-win ERP</title>
    </information>
    <security>
    <all-permissions/>
    </security>
    <update check="always" policy="always"/>
    <resources>
    <javafx-runtime version="2.1+" href="http://javadl.sun.com/webapps/download/GetFile/javafx-latest/windows-i586/javafx2.jnlp"/>
    <java href="http://java.sun.com/products/autodl/j2se" version="1.6+"/>
    <jar href="http://192.168.18.35:8088/joffice/webstart/Win2Erp.jar" download="eager" main="false"/>
    <jar href="http://192.168.18.35:8088/joffice/webstart/libs/apache-mime4j-0.6.jar" download="eager" main="false"/>
    ... ...
    </resources>
    <javafx-desc main-class="com.win2.erp.ui.ErpMain">
    *<param name="sid" value="7F2166F960AD42A3A0552488B580F8A5"/>*
    <param name="domain" value="192.168.18.35"/>
    </javafx-desc>
    </jnlp>
    network: prepareToLaunch: offlineOnly=true
    *network: found the cache entry [url: http://192.168.18.35:8088/joffice/webstart/Win2Erp.jarjnlp, η‰ˆζœ¬: null] prevalidated=false/0*
    cache: Adding MemoryCache entry: http://192.168.18.35:8088/joffice/webstart/Win2Erp.jarjnlp
    basic: Loaded descriptor from cache at: http://192.168.18.35:8088/joffice/webstart/Win2Erp.jarjnlp
    temp: new XMLParser with source:
    temp:
    <jnlp spec="1.0" xmlns:jfx="http://javafx.com" version="1.3">
    <information>
    <title>Mutual-win ERP</title>
    </information>
    <update check="always" policy="always"/>
    <resources>
    <javafx-runtime version="2.1+" href="http://javadl.sun.com/webapps/download/GetFile/javafx-latest/windows-i586/javafx2.jnlp"/>
    </resources>
    <resources>
    <j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se"/>
    <jar href="Win2Erp.jar" size="223880" download="eager"/>
    <jar href="libs/apache-mime4j-0.6.jar" size="345048" download="eager"/>
    ... ...
    </resources>
    <security>
    <all-permissions/>
    </security>
    <javafx-desc width="900" height="800" main-class="com.win2.erp.ui.ErpMain" name="Win2Erp">
    *<param name="sid" value="073FAD1B28935912EB6DC7F1EFCE1E13"/>*
    <param name="domain" value="192.168.18.35"/>
    </javafx-desc>
    </jnlp>
    temp:

    returning ROOT as follows:
    ... ...
  • 2. Re: Java7, cannot clear the JNLP cache of dynamically generated JNLP.
    817614 Explorer
    Currently Being Moderated
    You could try using the original URL http://192.168.18.35:8088/joffice/webstart/startfx.jsp?JSESSIONID=7F2166F960AD42A3A0552488B580F8A5 to do the cleanup.
    Anyway, if the same code works in 6 does not with 7 then it is a regression. You should file a bug with Oracle providing a test case or enough details to reproduce.

    Edited by: ntn on Dec 14, 2012 1:44 PM
  • 3. Re: Java7, cannot clear the JNLP cache of dynamically generated JNLP.
    950421 Newbie
    Currently Being Moderated
    Hi ntn,

    It's the same if use the original URL. I will file the BUG later on.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points