Re: [JNLP]trying to install a jnlp app on a web server
Daniel Moyne wrote:
I have a Java app ..
GenealogyJ? (And as an aside, why are people so coy
when giving details on groups? A 'Java app' - gee,
could you vague that up a little for me?)
..installed locally that works fine on my machine and I want
to make it work on my web server ; the architectecture of this app is as
follows :
- "run.sh" (script that launches the app with this command line :
$JAVA_HOME -Dapp.log.level=FINE -Xmx512m -Xms32m -jar run.jar
Yep. Except for the logging, and that it is a .bat
on Win., it is looking the same as GenJ launch file
here.
Note that I have had some success launching the GenealogyJ
*applet*, though the entire process was rather obscure,
and poorly documented (I only knew it was possible from
stumbling across someone else's deployment).
...
I did the following :
Forget what you did for the moment, and get to what you
are trying to achieve. Frame it in terms of "I want to
offer the end user..". For example, in my instance, I
"want(ed) to offer the end user the opportunity to
view/browse a genealogical file coming directly off
my site".
My "my_file.jnlp" file is like this :
It is malformed, and contains some odd aspects.
To check the well formedness, try this tool..
<http://www.physci.org/xml/xmltools.html#xmlwfc>
It is not especially good at identifying the exact
part of the file where the error occurs, but the
'short answer' is that is is not liking the 'accute e'
characters (are they 'e accute', or 'e accent'?). I
am sure such characters can be included in XML files
in some form, though apparently &eaccute; is not the
correct way.
Other comments in-line..
<?xml version="1.0" encoding="utf-8"?>
<!-- Test for Web Start Deployment -->
<jnlp spec="1.0+" codebase="http://virtual1.com/genealogy"
href="my_file.jnlp">
<information>
<title>AZUN</title>
<vendor>Daniel Moyne</vendor>
<homepage href="http://localhost/genealogy"/>
This href clashes with the codebase above.
I expect you mean "." as the homepage.
<description>G??n??alogie</description>
Some of those problem 'e's.
<description kind="short">G??n??alogie///</description>
Why the '///'?
<icon href="icon.gif"/>
<icon kind="splash" href="splash.gif"/>
<offline-allowed/>
</information>
<security>
<all-permissions/>
</security>
The applet can be deployed in a sandbox.
If all you want to do is *display* a genealogy file,
the JNLP does not need all-permissions.
<resources os="Linux">
So what resources are Win. and Mac. supposed to get?
AFAIU, GenJ has no system specific parts, so remove
the os="Linux" for an x-plat version.
<j2se version="1.5+"/>
GenJ is compatible with Java 1.1, though the mimimum
Java for any JNLP (j2se/java element) is 1.2.
<jar href="run.jar"/>
<jar href="lib/genj.jar"/>
<jar href="lib/genj_en.jar"/>
<jar href="lib/genj_fr.jar"/>
<jar href="lib/console.jar"/>
<jar href="lib/geo.jar"/>
<jar href="lib/graphj.jar"/>
<jar href="lib/jump.jar"/>
<jar href="lib/jfreechart.jar"/>
<jar href="lib/jhbasic.jar"/>
<jar href="lib/libreadline-java-0.8.0.jar"/>
Some big resources there. The applet has only one jar. *
</resources>
<application-desc/>
</jnlp>
- <ressources> some jar files : the main one "run.jar" and all those
included in "lib" directory (what about others ?).
* So I cannot understand why you added al those.
When I click on my jnlp file I get from Webstart an error message saying
that different certificates have been used which for me is not clear as I
have changed certificates with my own keystore on all jar files which here
somehow modifies the original application that runs locally with no
problems !
Note that when the sandboxed applet is deployed,
javaws does not even bother to verify the code
signature, if it is possible to deploy this 'app'
sandboxed, it might be possible to sidestep this
entire problem.
I prefer to start with these basic questions :
(1) what is the use <ressources> : to download jar files from main server to
client computer
Yes. jar's (as well as nativelib's and components) are cached
on the client's computer. There are some subtleties come in for
'lazy' download jar's, but hese are all 'eager'.
..and if yes what about the other files containing data ?
Put them in a jar and add them to a 'jar' element.
No problem. The resources will be available to the
application's classpath (can use getResource() to
find them).
(2) in the jnlp file where is the important line telling where to start the
application here "run.jar" as the main jar files if all other jar files
must be include as well ?
Depends. JWS assumes the first jar contains a main
(unless told otherwise - check the JNLP spec. for details)
If the amin jar contains a manifest that specifies the
main class, it is not necessary to refer to it in the
main-class attribute of the application-desc element.
(2) how to provide to WebStart the equivalent of :
"-Dapp.log.level=FINE -Xmx512m -Xms32m"
Memory requirements can be specified in the j2se element.
See the 'Giffer' example for usage.
<http://www.physci.org/jws/#giffer>
I will have more from answers.
You will gain a great deal from downloading the JNLP
spec., and the JNLP Developers guide. The last one is
browsable on-line, but the spec. is not, and contains
far more, and more valuable, information on the JNLP
API and usage of JNLP files.
HTH
--
Andrew Thompson
http://www.athompson.info/andrew/
Message posted via http://www.javakb.com