Need to revise my JNLP file

Discussion in 'Java' started by Ramon F Herrera, Jul 11, 2009.

  1. Greetings to all. Long time no see. I am wearing my Java developer hat
    again.

    It has been a while since the last time I deployed my apps through
    JNLP, and something is not working properly. I need a sanity check.

    This what I have done so far.

    (1) I took the sample file below from the Java site.

    Question 1: The lines where the "codebase" and "href" are defined are
    really a self-reference, correct? IOW: The concatenation of "codebase"
    and its "href" should provide the JNLP file in question, right? This
    is like a file containing its filename inside.

    (2) I assume that I have to modify 4 lines:

    (2a) The line where "codebase" is defined
    (2b) The line where the first "href" is defined
    (2c) The line where "jar href" is defined
    (2d) The line where "application-desc main-class" is defined.

    Am I doing anything wrong this far?

    TIA,

    -Ramon


    ------------------------------------------------

    http://java.sun.com/docs/books/tutorial/deployment/webstart/deploying.html

    <?xml version="1.0" encoding="utf-8"?>
    <!-- JNLP File for Notepad -->

    <jnlp spec="1.0+"
    codebase="http://java.sun.com/docs/books/tutorialJWS/deployment/
    webstart/examples/"
    href="Notepad.jnlp">
    <information>
    <title>Notepad Demo</title>
    <vendor>The Java(tm) Tutorial: Sun Microsystems, Inc.</vendor>
    <description>Notepad Demo</description>
    <homepage href="http://java.sun.com/docs/books/tutorial/
    deployment/webstart/running.html"/>
    <description kind="short">ClickMeApp uses 3 custom classes plus
    several
    standard ones</description>
    <offline-allowed/>
    </information>
    <resources>
    <jar href="Notepad.jar"/>
    <j2se version="1.6+"
    href="http://java.sun.com/products/autodl/j2se"/>
    </resources>
    <application-desc main-class="Notepad"/>
    </jnlp>
    Ramon F Herrera, Jul 11, 2009
    #1
    1. Advertising

  2. In article
    <>,
    Ramon F Herrera <> wrote:

    > Greetings to all. Long time no see. I am wearing my Java developer hat
    > again.
    >
    > It has been a while since the last time I deployed my apps through
    > JNLP, and something is not working properly. I need a sanity check.
    >
    > This what I have done so far.
    >
    > (1) I took the sample file below from the Java site.
    >
    > Question 1: The lines where the "codebase" and "href" are defined are
    > really a self-reference, correct? IOW: The concatenation of "codebase"
    > and its "href" should provide the JNLP file in question, right? This
    > is like a file containing its filename inside.
    >
    > (2) I assume that I have to modify 4 lines:
    >
    > (2a) The line where "codebase" is defined
    > (2b) The line where the first "href" is defined
    > (2c) The line where "jar href" is defined
    > (2d) The line where "application-desc main-class" is defined.
    >
    > Am I doing anything wrong this far?


    I think so. I just moved several JARs to Google Sites. The essential
    change was using a full URL for the href attribute of <jar/>. The
    example shows a path relative to the <jnlp/> codebase attribute, but
    that failed to get past Google redirection.

    For example, <http://sites.google.com/site/drjohnbmatthews/subway>:

    <?xml version="1.0" encoding="utf-8"?>
    <!-- JNLP File for Subway -->
    <jnlp spec="1.0+"
    codebase="http://sites.google.com/site/drjohnbmatthews/subway"
    href="Subway.jnlp">
    <information>
    <title>Subway</title>
    <vendor>John B. Matthews.</vendor>
    <description>Subway Simulation</description>
    <homepage href="http://sites.google.com/site/drjohnbmatthews/subway"/>
    <description kind="short">Subway Simulation</description>
    <offline-allowed/>
    </information>
    <resources>
    <jar href=
    "http://sites.google.com/site/drjohnbmatthews/subway/Subway.jar"/>
    <j2se version="1.5+" href="http://java.sun.com/products/autodl/j2se"/>
    </resources>
    <application-desc main-class="Subway"/>
    </jnlp>

    --
    John B. Matthews
    trashgod at gmail dot com
    <http://sites.google.com/site/drjohnbmatthews>
    John B. Matthews, Jul 11, 2009
    #2
    1. Advertising

  3. On Jul 11, 3:52 pm, "John B. Matthews" <> wrote:
    > In article
    > <>,
    >  Ramon F Herrera <> wrote:
    >
    >
    >
    > > Greetings to all. Long time no see. I am wearing my Java developer hat
    > > again.

    >
    > > It has been a while since the last time I deployed my apps through
    > > JNLP, and something is not working properly. I need a sanity check.

    >
    > > This what I have done so far.

    >
    > > (1) I took the sample file below from the Java site.

    >
    > > Question 1: The lines where the "codebase" and "href" are defined are
    > > really a self-reference, correct? IOW: The concatenation of "codebase"
    > > and its "href" should provide the JNLP file in question, right? This
    > > is like a file containing its filename inside.

    >
    > > (2) I assume that I have to modify 4 lines:

    >
    > > (2a) The line where "codebase" is defined
    > > (2b) The line where the first "href" is defined
    > > (2c) The line where "jar href" is defined
    > > (2d) The line where "application-desc main-class" is defined.

    >
    > > Am I doing anything wrong this far?

    >
    > I think so. I just moved several JARs to Google Sites. The essential
    > change was using a full URL for the href attribute of <jar/>. The
    > example shows a path relative to the <jnlp/> codebase attribute, but
    > that failed to get past Google redirection.
    >
    > For example, <http://sites.google.com/site/drjohnbmatthews/subway>:
    >
    > <?xml version="1.0" encoding="utf-8"?>
    > <!-- JNLP File for Subway -->
    > <jnlp spec="1.0+"
    >  codebase="http://sites.google.com/site/drjohnbmatthews/subway"
    >  href="Subway.jnlp">
    >  <information>
    >   <title>Subway</title>
    >   <vendor>John B. Matthews.</vendor>
    >   <description>Subway Simulation</description>
    >   <homepage href="http://sites.google.com/site/drjohnbmatthews/subway"/>
    >   <description kind="short">Subway Simulation</description>
    >   <offline-allowed/>
    >  </information>
    >  <resources>
    >   <jar href=
    >    "http://sites.google.com/site/drjohnbmatthews/subway/Subway.jar"/>
    >   <j2se version="1.5+" href="http://java.sun.com/products/autodl/j2se"/>
    >  </resources>
    >  <application-desc main-class="Subway"/>
    > </jnlp>
    >
    > --
    > John B. Matthews
    > trashgod at gmail dot com
    > <http://sites.google.com/site/drjohnbmatthews>


    Thanks for the tip, John. After following your suggestion, I am making
    progress: now the app starts, but its libraries seem to be absent,
    even after I used fully qualified URLs.

    Regards,

    -Ramon
    Ramon F Herrera, Jul 11, 2009
    #3
  4. Ramon F Herrera

    Roedy Green Guest

    On Sat, 11 Jul 2009 11:47:29 -0700 (PDT), Ramon F Herrera
    <> wrote, quoted or indirectly quoted someone who
    said :

    >
    >(2) I assume that I have to modify 4 lines:
    >
    >(2a) The line where "codebase" is defined
    >(2b) The line where the first "href" is defined
    >(2c) The line where "jar href" is defined
    >(2d) The line where "application-desc main-class" is defined.


    In the Replicator, I generate the JNLP file with Java code. If you
    did it that way, you would have to modify only one field, and your
    Java code would make all the necessary adjustments.
    --
    Roedy Green Canadian Mind Products
    http://mindprod.com

    "For reason that have a lot to do with US Government bureaucracy, we settled on the one issue everyone could agree on, which was weapons of mass destruction."
    ~ Paul Wolfowitz 2003-06, explaining how the Bush administration sold the Iraq war to a gullible public.
    Roedy Green, Jul 12, 2009
    #4
  5. In article
    <>,
    Ramon F Herrera <> wrote:

    [...]

    > Thanks for the tip, John. After following your suggestion, I am
    > making progress: now the app starts, but its libraries seem to be
    > absent, even after I used fully qualified URLs.


    You can list multiple JAR files or use the extension mechanism. See "Can I
    rely on Class-Path in the manifest file?":

    <http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/faq.html>

    Here's an example that uses extensions for jogl and joal JARs:

    <http://www.bytonic.de/downloads/jake2_jogl11.jnlp>

    --
    John B. Matthews
    trashgod at gmail dot com
    <http://sites.google.com/site/drjohnbmatthews>
    John B. Matthews, Jul 12, 2009
    #5
  6. On Jul 12, 4:47 am, Ramon F Herrera <> wrote:
    > ...
    > It has been a while since the last time I deployed my apps through
    > JNLP, and something is not working properly. I need a sanity check.


    JaNeLA can provide (at least the bulk of) that check.
    <http://pscode.org/janela/>

    --
    Andrew T.
    pscode.org
    Andrew Thompson, Jul 12, 2009
    #6
  7. Ramon F Herrera wrote:
    > Question 1: The lines where the "codebase" and "href" are defined are
    > really a self-reference, correct? IOW:


    I think the reason they are a self reference is that when a browser
    loads a jnlp file, it saves a copy to its cache area and then invokes
    the java application manager passing that local file name. The manager
    then checks to see if the local copy is the same as the remote but it
    was only given the local name so it needs the remote name to be in the
    jnlp file.

    Can someone else confirm this?

    Jeff Coffield
    Jeffrey H. Coffield, Jul 12, 2009
    #7
  8. Ramon F Herrera

    Roedy Green Guest

    On Sat, 11 Jul 2009 11:47:29 -0700 (PDT), Ramon F Herrera
    <> wrote, quoted or indirectly quoted someone who
    said :

    >I need a sanity check.


    there are several. See http://mindprod.com/jgloss/jnlp.html
    --
    Roedy Green Canadian Mind Products
    http://mindprod.com

    "For reason that have a lot to do with US Government bureaucracy, we settled on the one issue everyone could agree on, which was weapons of mass destruction."
    ~ Paul Wolfowitz 2003-06, explaining how the Bush administration sold the Iraq war to a gullible public.
    Roedy Green, Jul 13, 2009
    #8
  9. Ramon F Herrera

    Roedy Green Guest

    On Sun, 12 Jul 2009 10:14:09 -0700, "Jeffrey H. Coffield"
    <> wrote, quoted or indirectly quoted
    someone who said :

    >Can someone else confirm this?


    Just one other datapoint. If you look at the JNLP file with the
    jawaws viewer, you will see the cached version has been modified from
    the actual posted version.
    --
    Roedy Green Canadian Mind Products
    http://mindprod.com

    "For reason that have a lot to do with US Government bureaucracy, we settled on the one issue everyone could agree on, which was weapons of mass destruction."
    ~ Paul Wolfowitz 2003-06, explaining how the Bush administration sold the Iraq war to a gullible public.
    Roedy Green, Jul 13, 2009
    #9
  10. Ramon F Herrera

    Roedy Green Guest

    On Sat, 11 Jul 2009 11:47:29 -0700 (PDT), Ramon F Herrera
    <> wrote, quoted or indirectly quoted someone who
    said :

    >(2a) The line where "codebase" is defined
    >(2b) The line where the first "href" is defined


    I use the codebase to define the directory within the website where
    the files are and the href to define the individual files within that
    directory.
    --
    Roedy Green Canadian Mind Products
    http://mindprod.com

    "For reason that have a lot to do with US Government bureaucracy, we settled on the one issue everyone could agree on, which was weapons of mass destruction."
    ~ Paul Wolfowitz 2003-06, explaining how the Bush administration sold the Iraq war to a gullible public.
    Roedy Green, Jul 13, 2009
    #10
  11. On Jul 11, 2:47 pm, Ramon F Herrera <> wrote:
    > Greetings to all. Long time no see. I am wearing my Java developer hat
    > again.
    >
    > It has been a while since the last time I deployed my apps through
    > JNLP, and something is not working properly. I need a sanity check.
    >
    > This what I have done so far.
    >
    > (1) I took the sample file below from the Java site.
    >
    > Question 1: The lines where the "codebase" and "href" are defined are
    > really a self-reference, correct? IOW: The concatenation of "codebase"
    > and its "href" should provide the JNLP file in question, right? This
    > is like a file containing its filename inside.
    >
    > (2) I assume that I have to modify 4 lines:
    >
    > (2a) The line where "codebase" is defined
    > (2b) The line where the first "href" is defined
    > (2c) The line where "jar href" is defined
    > (2d) The line where "application-desc main-class" is defined.
    >
    > Am I doing anything wrong this far?
    >
    > TIA,
    >
    > -Ramon
    >
    > ------------------------------------------------
    >
    > http://java.sun.com/docs/books/tutorial/deployment/webstart/deploying...
    >
    > <?xml version="1.0" encoding="utf-8"?>
    > <!-- JNLP File for Notepad -->
    >
    > <jnlp spec="1.0+"
    >       codebase="http://java.sun.com/docs/books/tutorialJWS/deployment/
    > webstart/examples/"
    >       href="Notepad.jnlp">
    >    <information>
    >       <title>Notepad Demo</title>
    >       <vendor>The Java(tm) Tutorial: Sun Microsystems, Inc.</vendor>
    >       <description>Notepad Demo</description>
    >       <homepage href="http://java.sun.com/docs/books/tutorial/
    > deployment/webstart/running.html"/>
    >       <description kind="short">ClickMeApp uses 3 custom classes plus
    > several
    >        standard ones</description>
    >       <offline-allowed/>
    >    </information>
    >    <resources>
    >         <jar href="Notepad.jar"/>
    >         <j2se version="1.6+"
    >               href="http://java.sun.com/products/autodl/j2se"/>
    >    </resources>
    >    <application-desc main-class="Notepad"/>
    > </jnlp>



    This is a follow-up question, related to JNLP development.

    It seems that my debugging may be affected by running a version(s)
    from the cache. I am not sure if the cached stuff is the remote JNLP
    file, the downloaded (hopefully) executable JAR and/or the auxiliary
    JARs with libraries and images.

    How can I make sure that only the latest and greatest versions are
    being used?

    Isn't there a way to use a version number to force download and use of
    the most recent version?

    TIA,

    -Ramon
    Ramon F Herrera, Jul 13, 2009
    #11
  12. On Jul 14, 1:35 am, Ramon F Herrera <> wrote:
    >..
    > This is a follow-up question, related to JNLP development.


    Why was it necessary to quote the entire original
    post in the follow-up question?

    > It seems that my debugging may be affected by running a version(s)
    > from the cache. I am not sure if the cached stuff is the remote JNLP
    > file, the downloaded (hopefully) executable JAR and/or the auxiliary
    > JARs with libraries and images.
    >
    > How can I make sure that only the latest and greatest versions are
    > being used?


    Well, I'm not so sure about debugging off the site,
    but generally during development, I launch a local
    version of the app. and override the codebase at
    runtime.

    If you are concerned about Jar versions, insert an
    Implementation-Version in the manifest of each Jar.
    JNLP versions, add a property or argument to the
    JNLP file. Log both at runtime.

    AFAIU, the JNLP servlet provides ways to get over a
    lot of caching problems, but I have not had cause to
    use it yet.

    If you really need to absolutely guarantee a fresh
    install, try temporarily moving the Java cache
    location. That will get around both Jar and JNLP
    caching (so long as you are not fool enough to try
    launching the app. from an existing menu item or
    desktop shortcut).

    --
    Andrew T.
    pscode.org
    Andrew Thompson, Jul 13, 2009
    #12
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jcnews
    Replies:
    147
    Views:
    2,503
    stoma
    Oct 20, 2004
  2. Sean Berry

    Help a newbie revise my program

    Sean Berry, Apr 26, 2004, in forum: Python
    Replies:
    2
    Views:
    301
    Marc 'BlackJack' Rintsch
    Apr 26, 2004
  3. matrix

    revise my code

    matrix, Nov 3, 2006, in forum: Java
    Replies:
    2
    Views:
    370
    Andrew Thompson
    Nov 4, 2006
  4. matrix

    revise this code

    matrix, Nov 4, 2006, in forum: Java
    Replies:
    0
    Views:
    353
    matrix
    Nov 4, 2006
  5. Donald Welker

    Code fragment to revise CustomSD SDDL for Event Log

    Donald Welker, Sep 27, 2005, in forum: ASP .Net Security
    Replies:
    0
    Views:
    154
    Donald Welker
    Sep 27, 2005
Loading...

Share This Page