User Tools

Site Tools


java:jws

This is an old revision of the document!


Java Web Start a.k.a. JNLP

Disclaimer: these are only some note – primarily for myself

Java Tutorial on Deployment

.jnlp Example

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jnlp PUBLIC "-//Sun Microsystems, Inc.//DTD JNLP 1.5//EN" "http://www.netbeans.org/jnlp/DTD/jnlp.dtd">
<jnlp codebase="http://ieg.ifs.tuwien.ac.at/projects/VisualizingPatientCohorts/" href="anscp.jnlp">
  <information>
    <title>Animated Scatter Plot</title>
    <vendor>Vienna University of Technology, Danube University Krems</vendor>
    <homepage href="http://ike.donau-uni.ac.at/~rind/jws/anscp.jnlp"/>
    <description>Visualizing Patient Cohorts by Animated Scatter Plots</description>
    <icon href="default"/>
    <shortcut online="true"/>
  </information>
  <security>
    <all-permissions/>
  </security> 
  <resources>
    <j2se href="http://java.sun.com/products/autodl/j2se" version="1.6+"/>
    <jar href="anscp-2.0.1.jar" main="true"/>
    <jar href="log4j-1.2.15.jar"/>
  </resources>
  <application-desc main-class="main.Main">
    <argument>-data</argument>
    <argument>http://ike.donau-uni.ac.at/~rind/jws/diabetes-real-ano-en.txt</argument>
  </application-desc>
</jnlp>

JAXB

Problem: JAXB requires (some) reflection

Solution: you need security permissions in .jnlp file

References: http://tech.javayogi.com/blogs/blog4.php/2010/08/23/jaxb-jax-ws-web-services-with-unsinged-java-applet

Resources

Problem: ClassLoader.getSystemResourceAsStream(str) does not work

Solution: use Thread.currentThread().getContextClassLoader().getResource(str).openStream() instead

Reference: http://forums.sun.com/thread.jspa?threadID=5305945

Sign JAR file

keytool -genkeypair -validity 900
 
jarsigner anscp-2.0.1.jar mykey

Note:

  • default validity is only 6 months
  • mykey is default alias
  • you need to sign all .jar files
java/jws.1286810356.txt · Last modified: 2010/10/11 17:19 by Alexander Rind

alex @ ieg: home about me publications research