ABOUT US

|

SUPPORT

|

BLOG

DOWNLOADS    

 

 

 

 


 

 

Deploying WebRenderer via Java WebStart

 

 

 

 

 

 

Java WebStart is a process of deploying Java applications over the Internet. WebStart applications are acompanied by some specific files including a JNLP file. A core part of the JNLP file is the codebase tag. This tag must point to the server on which your application resides (such as: codebase="http://www.webrenderer.com/webstart/").

Core Requirements

When deploying WebRenderer through WebStart we have had success by doing the following:

1 - All JARs must be signed with the same key file.

Key file generation:

keytool -genkey -keystore WRKeystore -alias wrstore

File wrstore generated, then

Jars signing:

jarsigner -keystore WRKeystore <jarname> wrstore

e.g to sign webrenderer.jar

jarsigner -keystore WRKeystore webrenderer.jar wrstore

3. Write the JNLP  file
Heres an example of codebase in a JNLP file (please note the Security section):

<jnlp
spec="1.0+"
codebase="{set here base URL where all jars stored for example http://www.webrenderer.com/webstart/}"
href="{Your application name}.jnlp">
<security>
    <all-permissions/>
</security>
<resources>
    <j2se version="1.4"/>
    <jar href="{Your application jar}"/>
    <jar href="webrendererse.jar"/>
  </resources>


Picking the platform in JNLP

  <resources os="Windows">
    <jar href="webrendererse-win.jar"/>
    <jar href="corecomponentsse-win.jar"/>
  </resources>
  <resources os="Linux">
    <jar href="webrendererse-linux.jar"/>
    <jar href="corecomponentsse-linux.jar"/>
  </resources>
  <resources os="Mac OS X">
    <jar href="webrendererse-osx.jar"/>
    <jar href="corecomponentsse-osx.jar"/>
  </resources>
  <resources os="Sun">
    <jar href="webrendererse-solaris.jar"/>
    <jar href="corecomponentsse-solaris.jar"/>
  </resources>


Using this method to deploy will ensure the correct files are downloaded to the client WebStart based on the platform you are running, amounting to an efficient cross-platform distribution.

Closing WebRenderer when your application terminates

You must call System.exit(0); when you close your Java WebStart application, to destroy the WebRenderer instance. If you do not call System.exit(0) your application will still be running without a Window and if you try to run your application again, you will receive a java.io.FileNotFoundException, which will point to WebRenderer.
 

 

 

 

 

 

Copyright © JadeLiquid Software - www.jadeliquid.com