This discussion is archived
7 Replies Latest reply: Feb 19, 2013 3:18 PM by 839063 RSS

JNLP not being updated

990898 Newbie
Currently Being Moderated
Hi,

I have an existing javafx 2 application which i have updated to used a new library - joda time. When i run local as a standalone application everything works fine . But when i run as an applet the application uses an older jnpl and fails to run as there is no reference to the new jar file. The new jnlp looks like
 
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0" xmlns:jfx="http://javafx.com" href="TCard.jnlp">
  <information>
    <title>TCard</title>
    <vendor>alan</vendor>
    <description>Sample JavaFX 2.0 application.</description>
    <offline-allowed/>
  </information>
  <resources>
    <jfx:javafx-runtime version="2.2+" 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="TCard.jar" size="113284" download="eager" />
    <jar href="lib/eclipselink-2.3.2.jar" size="6694861" download="eager" />
    <jar href="lib/javax.persistence-2.0.3.jar" size="138903" download="eager" />
    <jar href="lib/joda-time-2.1.jar" size="624711" download="eager" />
    <jar href="lib/mysql-connector-java-5.1.18-bin.jar" size="799412" download="eager" />
    <jar href="lib/org.eclipse.persistence.jpa.jpql_1.0.1.jar" size="721671" download="eager" />
  </resources>
<security>
  <all-permissions/>
</security>
  <applet-desc  width="1920" height="1080" main-class="com.javafx.main.NoJavaFXFallback"  name="TCard" >
    <param name="requiredFXVersion" value="2.2+"/>
  </applet-desc>
  <jfx:javafx-desc  width="1920" height="1080" main-class="tcard.TCard"  name="TCard" />
  <update check="background"/>
</jnlp>
 
But when I view the jnlp int the 'Java Cache Viewer'
<jnlp spec="1.0" codebase="http://invapp/" href="http://invapp/TCard.jnlp">
  <information>
    <title>TCard</title>
    <vendor>alan</vendor>
    <homepage href="null"/>
    <description>Sample JavaFX 2.0 application.</description>
    <offline-allowed/>
  </information>
  <update check="background" policy="always"/>
  <resources>
    <javafx-runtime version="2.0+" 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://invapp/TCard.jar" download="eager" main="false"/>
    <jar href="http://invapp/lib/eclipselink-2.3.0.jar" download="eager" main="false"/>
    <jar href="http://invapp/lib/javax.persistence-2.0.jar" download="eager" main="false"/>
    <jar href="http://invapp/lib/mysql-connector-java-5.1.13-bin.jar" download="eager" main="false"/>
    <jar href="http://invapp/lib/org.eclipse.persistence.jpa.jpql_1.0.0.jar" download="eager" main="false"/>
  </resources>
  <applet-desc name="TCard" main-class="com.javafx.main.NoJavaFXFallback" width="1920" height="1080">
    <param name="requiredFXVersion" value="2.0+"/>
  </applet-desc>
  <javafx-desc main-class="tcard.TCard"/>
</jnlp>
This looks to be the jnlp from before the update. How can i get the application to use the new file?

I have tried to clear Java Cache and the browser cache but get the same result. I have tried IE and chrome but get the same result.
OS = windows 7 pro 64
java = 1.7.0_13 32 bit

Regards

Alan

Edited by: user13447797 on 13-Feb-2013 10:07

Edited by: user13447797 on 13-Feb-2013 10:24
  • 1. Re: JNLP not being updated
    shakir.gusaroff Expert
    Currently Being Moderated
    Hi. Replace
     update check="background"/
     
    with
      update check="always”
     
    in your JNLP file.
    I am not sure 100%.
  • 2. Re: JNLP not being updated
    839063 Newbie
    Currently Being Moderated
    Your browser should simply be downloading the jnlp file and handing it off to javaws so Chrome vs IE shouldn't be much different. It may or may not appear as a file download depending on it's settings. If the web server or browser fail to see that the file is new, they may hand off an old cached version. You say you have cleared the browser cache, so maybe it's some other cache. Using some web development tools like Chrome's developer tools or Live HTTP Headers or Firebug for Firefox can help. You could also test with telnet, wget or curl.

    Are you always re-launching the file from the browser by clicking the JNLP file, or do you use desktop shortcuts or the Java Cache Viewer? Maybe it has a hard time with invapp or that has moved. I normally specify a codebase in my jnlp files and notice you do not have one in your new version. I don't know if your old version didn't have it either and javaws wrote it in or if it did have one.

    Try calling javaws and give it the URL to your JNLP file. Eg javaws http://invapp/TCard.jnlp

    You can also try this tool, JaNeLA, for downloading and analyzing the JNLP file: http://pscode.org/janela/

    Best of luck,
  • 3. Re: JNLP not being updated
    Jeff Martin Newbie
    Currently Being Moderated
    Your new JNLP doesn't have a codebase or href element - I wonder if there could be a problem because the old one does?
  • 4. Re: JNLP not being updated
    990898 Newbie
    Currently Being Moderated
    Hi All,

    Thanks for the replys.
    I have managed to resolve the problem. The browser wasn't using the jnlp file but using the embedded one in the html file. This had been generated by Netbeans then modified by myself. That's is why it was show the old version of jar files.

    Regards

    Alan
  • 5. Re: JNLP not being updated
    839063 Newbie
    Currently Being Moderated
    What do you mean by embedding a JNLP file in the HTML file? How were you getting the browser to use an embedded JNLP?

    Do you mean the launch html file with the link to the JNLP file or the deployJava.js JavaScript was pointing at an old name like launch.jnlp instead of TCard.jnlp?

    Did you do anything with the codebase?

    I'm glad you got it sorted.
  • 6. Re: JNLP not being updated
    jsmith Guru
    Currently Being Moderated
    What do you mean by embedding a JNLP file in the HTML file? How were you getting the browser to use an embedded JNLP?
    See section 5.9.2 "Embed the Deployment Descriptor into the Web Page" of the JavaFX deployment guide.
    http://docs.oracle.com/javafx/2/deployment/packaging.htm#BABCJCHH
    It's a process supported by the JavaScript based deployment toolkit for JavaFX which allows you to place a base64 encoded jnlp inside the text of an html page so that a seperate network call is not required to fetch the jnlp from the server.
  • 7. Re: JNLP not being updated
    839063 Newbie
    Currently Being Moderated
    That explains the lack of codebase ref and why it is trickier to troubleshoot.

    Thanks.

    Edited by: 836060 on Feb 19, 2013 3:18 PM

Legend

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