Changes between Version 2 and Version 3 of PLATFORM_DEPLOYMENT_TARGET_JWS_R0


Ignore:
Timestamp:
01/06/09 23:40:10 (16 years ago)
Author:
jordan
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PLATFORM_DEPLOYMENT_TARGET_JWS_R0

    v2 v3  
    3939 
    4040= Implementation = 
    41 URL of the demo deployment: http://asteasolutions.net/~jordan/jws-demo/sophie2author.html 
     41 
     42== Demo == 
     43URL of the demo deployment: http://asteasolutions.net/~jordan/jws-demo/sophie2author.html. 
     44 
     45=== Introduction === 
     46To prepare an application for deployment via Java Web Start, you write a JNLP file (JWS reads it to know what to do) and package the appilcation into .jar files. Then you put the JNLP file and the .jar files into a folder that is served by a web server.[[BR]]The JNLP file describes the application. It tells JWS what's the application's name, where the aplication's .jar files are located and more. 
     47 
     48== Deploying Sophie 2 via Java Web Start == 
     49 1. Compile Sophie 2 into .jar files. 
     50 1. Put the .jar files into a temporary directory. 
     51 1. Prepare a JNLP file (e.g. by customizing the attached example) and put it in the temporary directory. 
     52 1. Generate a keypair and a self-signed certificate by using {{{keytool -genkeypair}}}. ''This step is done only once. The generated keypair and certificate are used many times.'' 
     53 1. Sign the {{{org.sophie2.launcher}}} and {{{org.sophie2.author}}} .jar files, one by one, using the {{{jarsigner}}} command: {{{jarsigner <file> mykey}}}. 
     54 1. Copy the contents of the temporary directory to a suitable location on the web server. 
     55 
     56 
     57== How launching works - step by step == 
     58 (some details are omitted) 
     59 1. The user clicks on a link in a web page. The link points to the JNLP file. 
     60 1. JWS loads the JNLP file and interprets its contents. 
     61 1. JWS loads the {{{org.sophie2.launcher}}} and {{{org.sophie2.author}}} bundles (.jar files) as instructed by the JNLP file. 
     62 1. JWS starts the application by executing the {{{main(String[] args)}}} method in the {{{org.sophie2.launcher.JavaWebStartMain}}} class, passing it the arguments prescribed by the JNLP file. 
     63 1. The launcher, now running, reads the list of bundles that comprise the Author edition of Sophie 2 from the {{{author.bundles.config}}} file (found in the {{{org.sophie2.author}}} .jar file). 
     64 1. The launcher creates a temporary directory that Felix will use as its bundle cache. 
     65 1. The launcher starts Felix and passes it the list of bundles and the URL's where they can be found. 
     66 1. Felix downloads the bundles and activates them, thus starting the application. 
     67 
     68== Limitations and expected problems == 
     69 * Native libraries are supported by Java Web Start, however, what really matters for Sophie 2 is Felix's support for them. 
     70 
     71== Notes == 
     72 * The web server hosting the JNLP file must be configured to serve {{{.jnlp}}} files with the {{{application/x-java-jnlp-file}}} MIME type. 
     73 * An example JNLP file is attached to this wiki page. 
     74 * Java Web Start downloads and caches .jar files. Felix downloads and caches .jar files too. The two cache mechanisms don't play well together. 
     75 * Felix needs unrestricted access to its bundle cache directory in order to function properly. That's why the JNLP file of Sophie 2 Author requests the {{{all-permissions}}} trusted execution environment. This trusted environement gives the application full access to the user's computer. There's an additional advantage to running in the trusted environment: the user doesn't get annoyed by security dialogs constantly popping up to request permission. 
     76 * For an application to be running in the {{{all-permissions}}} trusted execution environment, its .jar files must be signed. 
    4277 
    4378 
     
    4580 
    4681= Comments = 
     82 * A future revision of this task should resolve the problem of cache interaction between Java Web Start and Felix. 
     83 * There are a lot of things one can write in a JNLP file. A production deployment of Sophie 2 will need much richer JNLP file than offered in this demo deployment. 
    4784^(Write comments for this or later revisions here.)