Dynamically upload additional jar files using Web Start / JNLP

Web Start Developer's Guide states

All application resources must be extracted from the specified JAR files in the resource section of the JNLP file or obtained explicitly using an HTTP request to the web server.

It is recommended that you store resources in JAR files, as they will be cached on the local machine using Java Web Start.

Now I have some resources that I want to dynamically load after my application has been started (for example, OSGi packages). I can do this using simple HTTP, but I would like to use Web Start support for local caching and version / architecture dependent resources.

Is there a way to download additional jar files from the source code base (as indicated in the jnlp application file) using the web launch framework?

Or, alternatively: is there an already established way to integrate OSGi and Web Start that will save me the trouble of installing packages from the web launch server?

+6
java java-web-start osgi
source share
2 answers

If you make your application by itself based on the Equinox OSGI application, you can run it with all the additional packages you need.

This article " WebStarting Equinox OSGi Apps " can give you a good idea of ​​the necessary settings.

  • All packages must be deployed as signed JAR files.
  • You need a function that contains all the necessary packages.
  • When exporting this function, make sure that the PDE creates the Java Network Lauching Protocol (JNLP) file (checkbox in the export wizard) for this function
  • Provide the JNLP root file for your application
  • Deploy the application on the web server and make sure the web server knows about the mime type of the application / x-java-jnlp file

He also has an OSGI demo .

+4
source share

I have not tried, but look at the javax.jnlp.DownloadService API

+1
source share

All Articles