Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Need to revise my JNLP file

Reply
Thread Tools

Need to revise my JNLP file

 
 
Ramon F Herrera
Guest
Posts: n/a
 
      07-11-2009

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/tutor...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>

 
Reply With Quote
 
 
 
 
John B. Matthews
Guest
Posts: n/a
 
      07-11-2009
In article
<(E-Mail Removed)>,
Ramon F Herrera <(E-Mail Removed)> 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>
 
Reply With Quote
 
 
 
 
Ramon F Herrera
Guest
Posts: n/a
 
      07-11-2009
On Jul 11, 3:52*pm, "John B. Matthews" <(E-Mail Removed)> wrote:
> In article
> <(E-Mail Removed)>,
> *Ramon F Herrera <(E-Mail Removed)> 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

 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      07-12-2009
On Sat, 11 Jul 2009 11:47:29 -0700 (PDT), Ramon F Herrera
<(E-Mail Removed)> 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.
 
Reply With Quote
 
John B. Matthews
Guest
Posts: n/a
 
      07-12-2009
In article
<(E-Mail Removed)>,
Ramon F Herrera <(E-Mail Removed)> 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>
 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      07-12-2009
On Jul 12, 4:47*am, Ramon F Herrera <(E-Mail Removed)> 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
 
Reply With Quote
 
Jeffrey H. Coffield
Guest
Posts: n/a
 
      07-12-2009


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
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      07-13-2009
On Sat, 11 Jul 2009 11:47:29 -0700 (PDT), Ramon F Herrera
<(E-Mail Removed)> 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.
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      07-13-2009
On Sun, 12 Jul 2009 10:14:09 -0700, "Jeffrey H. Coffield"
<(E-Mail Removed)> 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.
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      07-13-2009
On Sat, 11 Jul 2009 11:47:29 -0700 (PDT), Ramon F Herrera
<(E-Mail Removed)> 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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: May have to revise my site's 404 page. OldGringo38 Computer Support 0 07-31-2010 08:49 PM
revise this code matrix Java 0 11-04-2006 03:19 PM
revise my code matrix Java 2 11-04-2006 02:48 AM
Should I revise chaotic content? jcnews HTML 147 10-20-2004 08:58 PM
Help a newbie revise my program Sean Berry Python 2 04-26-2004 06:16 AM



Advertisments