wiki:PLATFORM_DEPLOYMENT_TARGET_JWS_R0
Last modified 16 years ago Last modified on 02/17/09 16:50:36

Error: Macro BackLinksMenu(None) failed
compressed data is corrupt

Error: Macro TicketQuery(summary=PLATFORM_DEPLOYMENT_TARGET_JWS_R0, format=table, col=summary|owner|status|type|component|priority|effort|importance, rows=description|analysis_owners|analysis_reviewers|analysis_score|design_owners|design_reviewers|design_score|implementation_owners|implementation_reviewers|implementation_score|test_owners|test_reviewers|test_score|) failed
current transaction is aborted, commands ignored until end of transaction block

Analysis

Overview

Java Web Start is an application deployment technology that allows Java applications to be launched directly from the Web, without downloading and installing them first.
It should be possible for Sophie 2 (Author and Reader editions) to be launched directly from the Web.
This will ease users in trying out and using Sophie 2.

Task requirements

  • Demonstrate working JWS deployment of Sophie 2 Author - only basic UI with no media capabilities.
  • Write down the necessary steps for deploying Sophie 2 via Java Web Start.
  • Write down any limitations of the technology or expected future difficulties.

Task result

(Please note: Results are to be delivered on this wiki page - in the design and implementation sections.)

  • The URL of a demo JWS deployment of Sophie 2.
  • Documentation on deploying Sophie 2 via JWS.
  • Documentation on limitations of the technology and expected problems, in particular problems related to deploying Java apps that rely on native-code libraries.

Implementation idea

  • Read the documentation of Java Web Start.
  • If in need of web hosting, ask pac - he's responsible for the web servers.

(Here you can add related tasks that could be useful or helpful.)

How to demo

Go to the demo deployment page, click the link, wait for a while (be patient) and observe Sophie 2 Author starting up.

Design

Introduction

To 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 application into .jar files. Then you put the JNLP file and the .jar files into a folder that is served by a web server.
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.

Deploying Sophie 2 via Java Web Start

  1. Compile Sophie 2 into .jar files.
  2. Put the .jar files into a temporary directory.
  3. Prepare a JNLP file (e.g. by customizing the attached example) and put it in the temporary directory.
  4. Generate a keypair and a self-signed certificate by using keytool -genkeypair. This step is performed only once. The generated keypair and certificate are used many times.
  5. Sign the org.sophie2.launcher and org.sophie2.author .jar files, one by one, using the jarsigner command: jarsigner <file> mykey.
  6. Copy the contents of the temporary directory to a suitable location on the web server.

Note: The web server hosting the JNLP file must be configured to serve .jnlp files with the application/x-java-jnlp-file MIME type.

Implementation

Demo

URL of the demo deployment: http://asteasolutions.net/~jordan/jws-demo/sophie2author.html.

How launching works - step by step

(some details are omitted)

  1. The user clicks on a link in a web page. The link points to the JNLP file.
  2. JWS loads the JNLP file and interprets its contents.
  3. JWS loads the org.sophie2.launcher and org.sophie2.author bundles (.jar files) as instructed by the JNLP file.
  4. 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.
  5. 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).
  6. The launcher creates a temporary directory that Felix will use as its bundle cache.
  7. The launcher starts Felix and passes it the list of bundles and the URL's where they can be found.
  8. Felix downloads the bundles and activates them, thus starting the application.

Limitations and expected problems

  • Native libraries are supported by Java Web Start, however, what really matters is Felix's support for them.

Notes

  • An example JNLP file is attached to this wiki page. It is also available in the repository at source:trunk/sophie2-platform/src/main/resources/sophie2author.jnlp.
  • An alternate launcher class - org.sophie2.launcher.JavaWebStartMain - is used for Java Web Start. It was added in [1148] and is a modified copy of the standard launcher class org.sophie2.launcher.Main.
  • Java Web Start downloads and caches .jar files. Felix downloads and caches .jar files too. The two cache mechanisms don't play well together.
  • 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.
  • For an application to be running in the all-permissions trusted execution environment, its .jar files must be signed.

Testing

User documentation

(Not in user documentation yet.)

Release documentation

This tests opening Sophie Author via JWS.

Manual tests

770

Main tests

Testlink test ids: 770

Related tests

Testlink test ids: (none so far)

Reported bugs

(none so far)

Comments

  • There are a lot of things one can put in a JNLP file. A production deployment of Sophie 2 will need much richer JNLP file than offered in this demo deployment.
  • A future revision of this task should resolve the problem of cache interaction between Java Web Start and Felix.
  • The functionality that the org.sophie2.launcher.JavaWebStartMain class provides should be merged into org.sophie2.launcher.Main.
  • The Reader edition of Sophie 2 (when it appears) should be launchable via Java Web Start too.
  • A future revision of this task should optimize the download size in order to reduce download time (and improve user experience), e.g. by eliminating multiple copies of common dependencies.

(Write comments for this or later revisions here.)

Attachments