You are on page 1of 30

Deploying WebVue via Java Web Start

(JNLP)

www.pcvuesolutions.com

FRANCE - Paris
ARC Informatique
Head Office

GERMANY - Munich
PcVue GmbH

ITALY - Milan
PcVue Srl

UK - London
Control Technology International

USA - Boston
PcVue Inc

SINGAPORE - Singapore
PcVue Sea

MALAYSIA – Kuala Lumpur


PcVue Sdn Bhd

CHINA - Shangai
PcVue China

JAPAN - Nagoya
PcVue Japan

ARC Informatique
ISO 9001 : 2008
ISO 14001 : 2004
certified

ARC Informatique - Head Office address: 2 Avenue de la Cristallerie 92310 SEVRES - FRANCE
Private Limited Company capitalised at 750 000 € - RCS Nanterre B 320 695 356- APE 722 C - SIREN 320 695 356- VAT N° FR 19 320 695 356
Authorization

Name Stamp Date


Author(s) Bruno Nardin 04/12/2013

Editing Bruno Nardin

Authorization Armin Kaltenbacher 12/05/2014

Title: Deploying WebVue via Java Web Start (JNLP)


Reference: <Ref to be updated>
Last modification: 14 April 2016 Page 2/30
Revision history

Revision Author Action Editing Date Distribution


1.0a BN Creation AK 04/12/2013 Internal
1.0b DS Rework of deploying AK 06/11/2015 Internal
1.0c DS Rework of various chapters, AK, LM 12/11/2015 Internal
adding of Chapter 2
2.0a AK General revision and cleanup 18/11/2015 Internal
2.0b AK Updates according to inputs 04/12/2015 Internal
from reviewers
2.0c AK Updates according to inputs 14/04/2016 Public
from reviewers and feedback
from tests with legacy PcVue
versions

Title: Deploying WebVue via Java Web Start (JNLP)


Reference: <Ref to be updated>
Last modification: 14 April 2016 Page 3/30
SUMMARY

1 DEFINITIONS ....................................................................................................................................... 5

2 INTRODUCTION .................................................................................................................................. 6

2.1 Compatibility................................................................................................................................... 6
2.1.1 PcVue ............................................................................................................................................. 6
2.1.2 JRE .................................................................................................................................................. 6

2.2 About Java Web Start ..................................................................................................................... 6


2.3 Java Web Start Advantages ............................................................................................................ 7
2.4 Quick start – Step by Step tutorial .................................................................................................. 7
2.5 Basics of Java Web Start and JNLP .................................................................................................. 7
2.5.1 Installation of Java Web Start ........................................................................................................ 7
2.5.2 JNLP file.......................................................................................................................................... 8
2.5.3 Mime type ................................................................................................................................... 10
2.5.4 Certificate warnings ..................................................................................................................... 11
2.5.5 Creating a shortcut on the desktop ............................................................................................. 14
2.5.6 Removing WebVue from the system ........................................................................................... 15

2.6 Summary of prerequisites for using WebVue as a Java Web Start application ........................... 16

3 ADVANCED USAGE ............................................................................................................................ 17

3.1 Automatic Updates ....................................................................................................................... 17


3.2 Default document ......................................................................................................................... 17
3.3 Using multiple WebVue projects in parallel ................................................................................. 18
3.4 Passing parameters into WebVue ................................................................................................ 19
3.5 Embedding the link to the JNLP file in the index.html ................................................................. 20
3.5.1 Directly launching the WebVue applet from code ...................................................................... 21
3.5.2 Displaying a “Launch” button ...................................................................................................... 23

4 LIMITATIONS .................................................................................................................................... 26

4.1 Display, animations, viewers ........................................................................................................ 26


4.2 Fullscreen mode............................................................................................................................ 26
4.3 Security ......................................................................................................................................... 26
4.4 Dynamic parameters / session sharing with WST ........................................................................ 26

5 FAQ .................................................................................................................................................. 27

6 ADDENDUM...................................................................................................................................... 28

6.1 Alternative syntax for deploying WebVue as a Java Web Start Application ................................ 28

Title: Deploying WebVue via Java Web Start (JNLP)


Reference: <Ref to be updated>
Last modification: 14 April 2016 Page 4/30
1 Definitions
JRE Java Runtime Environment. Software package that contains what is
required to run a Java program. It includes a Java Virtual Machine
implementation together with an implementation of the Java Class
Library.

RIA Rich Internet Application. Web application that has similar characteristics
as a traditional desktop application and thus differs from simple web sites
(in particular in term of user interactions).

Java Web Start Technology to deploy Java desktop applications and Java Rich Internet
Applications over network.

JNLP Java Network Launch Protocol. Protocol that allows to load a Java
application from a network location and to execute it locally.

JNLP file Manifest file which includes all the information about how to deploy and
launch a Java Web Start application.

NPAPI Netscape Plugin Application Programming Interface. The technology used


by most web browsers to interface the JRE plug-in in order to embed Java
Applets.

Title: Deploying WebVue via Java Web Start (JNLP)


Reference: <Ref to be updated>
Last modification: 14 April 2016 Page 5/30
2 Introduction
WebVue is a Rich-Internet-Application (RIA) that is developed and deployed in the form of a
Java applet. Java applets are well-known for their capacity to be embedded and executed in a
web-browser context.

In some cases it can be desirable to deploy the WebVue thin-client as a one-click application
independently of any web browser.

These cases can be due to deployment considerations as well as other pragmatic reasons, for
example the expiring support for Java applets within major web browsers products.

Since major web-browser vendors such as Google and Mozilla have announced discontinued
support for NPAPI-plugins such as the Java Runtime plugin the number of cases in which a
web-browser independent deployment of the WebVue thin-client is needed is rapidly growing.

The Java Web Start technology allows distribution of Java applications and Java applets such
as WebVue as a downloadable one-click-application with no further installation procedure
required. Both is achieved by using the Java Network Launching Protocol (JNLP).

This document describes how to set up the environment for deploying the WebVue applet as a
Java Web Start component via JNLP.

2.1 Compatibility
2.1.1 PcVue
The compatibility of WebVue with Java Web Start has been tested with the following versions.

PcVue Version Java Web Start


PcVue 10.0 SP1 (build 16072) OK
PcVue 10.0 SP2 (build 26035) OK
PcVue 11.0 (build 06080) OK
PcVue 11.1 (build 06047) OK

Notes:

For other versions of PcVue please contact your local technical support agency.
All version above are also Web Start enabled. The feature is documented in the official product
documentation starting with PcVue 11.2.

2.1.2 JRE
All JRE versions supported by the respective PcVue version.

2.2 About Java Web Start


Using Java Web Start technology, standalone Java software applications can be deployed with
a single click over the network. Java Web Start ensures the most current version of the
application is used, as well as the correct version of the Java Runtime Environment (JRE). Java
Web Start is included in the Java Runtime Environment (JRE) since Java SE 4.

Title: Deploying WebVue via Java Web Start (JNLP)


Reference: <Ref to be updated>
Last modification: 14 April 2016 Page 6/30
2.3 Java Web Start Advantages
 One-click deployment
 Automatic Updates
Java Web Start ensures the most current version of the application will be deployed, as
well as the correct version of the Java Runtime Environment (JRE).
 Users can create a desktop shortcut to launch a Java Web Start application outside the
web browser
 Security
By default, applications have restricted access to local disk and network resources
because of running in a sandbox environment.
 Applications are cached locally for improved performance.
 Highly customizable.

Please see http://www.oracle.com/technetwork/java/javase/javawebstart/index.html for


additional information.

2.4 Quick start – Step by Step tutorial


1. Set up IIS virtual directories for your PcVue project.

2. Go to the WEB-directory of your PcVue project and create the webvue.jnlp-file. You
take the example below but you will have to modify it according to your needs (see
chapter 2.5.2 for details).

3. On IIS set the MIME type for the JNLP-file extensions (see chapter 2.5.3 for details).

4. Sign the WebVue applet with a certificate that is issued by a trusted authority (see
KB618 for details).

2.5 Basics of Java Web Start and JNLP


2.5.1 Installation of Java Web Start
Java Web Start is automatically installed with the JRE installation (on the client side), so there
is no need for further installations.

Title: Deploying WebVue via Java Web Start (JNLP)


Reference: <Ref to be updated>
Last modification: 14 April 2016 Page 7/30
2.5.2 JNLP file
To make Java Web Start run with your PcVue project you have to create a JNLP file. The JNLP
file includes all the deployment and configuration settings required for Java Web Start and
contains important information for the client, for example from where to receive the WebVue
applet and where to look for possible updates in the JNLP configuration, as well as a set of
other parameters.

This file needs to be put in the WEB folder of your PcVue project, for example:

C:\ARC Informatique\PcVue 11.2\Usr\[myProject]\WEB

The JNLP file configuration is put together in XML format. Please find the full description of the
syntax here:
https://docs.oracle.com/javase/tutorial/deployment/deploymentInDepth/jnlpFileSyntax.html

Or here:

http://lopica.sourceforge.net/ref.html

We recommend to name the file webvue.jnlp. But it also can have any other name, as long as
the file extension remains .jnlp.

Note:
Java Web Start can launch both Java applications and Java applets via JNLP. Since WebVue is
designed as a Java Applet, the JNLP file shall be configured to deploy WebVue as an applet,
which requires to use the “applet-desc” directive and not the “application-desc”.

See here a general example of a JNLP file with placeholders and find a real-life example below.

<?xml version="1.0" encoding="UTF-8"?>


<jnlp spec="1.0+" codebase="https://[hostname]:[port]/classes">

<information>
<title>WebVue</title>
<vendor>Arc Informatique</vendor>
</information>

<resources>
<j2se version="1.7+" href="http://java.sun.com/products/autodl/j2se"/>
<jar href="AiWebVue-signed.jar" main="true" />
</resources>

<security>
<all-permissions/>
</security>

<applet-desc
documentBase="https://[hostname]:[port]/[PcVueProject]/"
name="WebVue"
main-class="svfc.launcher.WebVueClient"
width="1680"
height="1050" />

Title: Deploying WebVue via Java Web Start (JNLP)


Reference: <Ref to be updated>
Last modification: 14 April 2016 Page 8/30
<update check="background"/>

</jnlp>

Example:

Notes:

(1) Java Web Start prevents usage of unsigned applets. For PcVue 11.0 and later a self-
signed version of the WebVue applet is available, called AiWebVue-signed.jar. Please
note that self-signed certificates do not guarantee a high level of security and shall only
be used for test purpose, but not in production environments. It is highly recommended
to sign the unsigned version of the WebVue applet, called AiWebVue.jar through a
certificate authority.

(2) If you are using PcVue 10.0 or earlier you need to take into account that in these
versions WebVue consisted of not only one jar-file, but of four.

The resources node needs to be changed accordingly:

<resources>
<j2se version="1.7+" href="http://java.sun.com/products/autodl/j2se"/>
<jar href="AiWebVue.jar" main="true" />
<jar href="AiTools.jar" />
Title: Deploying WebVue via Java Web Start (JNLP)
Reference: <Ref to be updated>
Last modification: 14 April 2016 Page 9/30
<jar href="AiTrend.jar" />
<jar href="AiAlarmList.jar" />
<jar href="AiLogList.jar" />
</resources>

Please note that all of the above files need to be signed!

2.5.3 Mime type


The mime type for the JNLP-file extension has to be defined for the WebVue web application on
the web server.

In the Windows Internet Information Services (IIS) Manager navigate to your WebVue web
application and double click on MIME Types in the right pane.

Insert the following:

Extension: .jnlp
MIME Type: application/x-java-jnlp-file

Now you are able to download the JNLP file from the following URL. The local Java Runtime
Environment on the client system will recognize the file extension, parse the JNLP-file and
launch WebVue according to the information provided in the file.

https://[hostname]:[port]/[PcVueProject]/webvue.jnlp

The following dialog appears:

Title: Deploying WebVue via Java Web Start (JNLP)


Reference: <Ref to be updated>
Last modification: 14 April 2016 Page 10/30
Click OK to start WebVue with the Java Web Start Launcher.

2.5.4 Certificate warnings


If you are using the self-signed version of the WebVue applet, for example the one that is
provided with PcVue 11.0 and later, you may see unexpected warnings before downloading or
launching the applet. This is because the same limitations and constraints apply as if you are
using WebVue from within a web browser. Please check the Knowledge Base articles KB685
and KB699 for details.

Title: Deploying WebVue via Java Web Start (JNLP)


Reference: <Ref to be updated>
Last modification: 14 April 2016 Page 11/30
It is absolutely recommended to use a signed jar file. With PcVue 11.0 and later ARC
Informatique supplies a signed jar file called AiWebVue-signed.jar. However, still self-signed

Title: Deploying WebVue via Java Web Start (JNLP)


Reference: <Ref to be updated>
Last modification: 14 April 2016 Page 12/30
applets will raise a warning with Java 1.7 Update 51 and later, which is why we recommend
you to sign the applet with a certificate coming from a trusted certificate authority (CA). For
details please check the article KB685.

As a workaround it is also possible to whitelist the applet’s origin on client-side. This can be
achieved by a Java Deployment Ruleset
(https://docs.oracle.com/javase/7/docs/technotes/guides/jweb/security/deployment_rules.htm
l) or by manually adding the WebVue host to the whitelist in the Java control panel on client-
side:

Title: Deploying WebVue via Java Web Start (JNLP)


Reference: <Ref to be updated>
Last modification: 14 April 2016 Page 13/30
2.5.5 Creating a shortcut on the desktop
For convenient access to WebVue a specific launcher icon can be put onto the desktop of the
client computer.

 Go to the Windows Control Panel.


 Open the Java Control Panel.

 Open the “Java Cache Viewer” by selecting “View” in the section “Temporary Internet
Files” of the tab “General “:

Title: Deploying WebVue via Java Web Start (JNLP)


Reference: <Ref to be updated>
Last modification: 14 April 2016 Page 14/30
 Select WebVue and click on the arrow button to create a shortcut.

The following icon will appear on your desktop and allow you to conveniently launch WebVue.

2.5.6 Removing WebVue from the system


If you want to remove WebVue from the client-side system you can do so by going to the Java
Cache Viewer, selecting WebVue and clicking the “Remove”-button from the toolbar.

Title: Deploying WebVue via Java Web Start (JNLP)


Reference: <Ref to be updated>
Last modification: 14 April 2016 Page 15/30
2.6 Summary of prerequisites for using WebVue as a
Java Web Start application
Server side:

- Virtual directory for PcVue project must be created.


- WebVue applet must be signed.
- JNLP file must be prepared.
- JNLP file extension must be registered on the Internet Information Services (IIS) for
the web application that is to be used.

Client side:

- Java Runtime Environment must be installed.


- If the WebVue applet does not confirm with Java security guidelines whitelisting the
origin of the WebVue applet may be necessary.

Title: Deploying WebVue via Java Web Start (JNLP)


Reference: <Ref to be updated>
Last modification: 14 April 2016 Page 16/30
3 Advanced usage
3.1 Automatic Updates
Java Web Start supports automatic updates. That means that the JNLP file and the WebVue
applet file are downloaded onto the client again in case their version has changed on the
server.

In order to enable automatic updates you must set the “href”-attribute in the “jnlp”-node of
the JNLP file. It needs to declare the location of the JNLP file on the server so that Java Web
Start on the client knows from where to get it after initial download.

Now the Java Web Start engine will check the server-side JNLP file for updates each time
before launching the WebVue application.

Note:
It is highly recommended to enable automatic updates! The benefit of that is that after
installing a new PcVue version on the server-side all WebVue clients will be updated
automatically.

By default, the Java Runtime Environment also updates itself automatically by retrieving its
latest update version from the Oracle servers. This functionality is independent of JNLP
automatic updates.

3.2 Default document


For further simplification you may want to set the JNLP file as the default document of your
WebVue web application. This has the benefit that client-side users do not need to add the
“/webvue.jnlp” to the navigation URL when accessing WebVue as a Java Web Start application.
To do so click on the respective WebVue application in the Internet Information Services (IIS)
Manager and double click “Default Document” in the right pane.

Title: Deploying WebVue via Java Web Start (JNLP)


Reference: <Ref to be updated>
Last modification: 14 April 2016 Page 17/30
Add a new default document corresponding to the name of your JNLP file.

Now you are able to access WebVue as a Java Web Start application by navigating to the
following URL:
https://[hostname]:[port]/[PcVueProject]

If you did the configuration as described above, you can start the application by entering the
same URL you would use for WebVue embedded in your web browser.

Note:
Do not use this simplification when you have a heterogeneous mix of users which are using
WebVue in the browser context and users which are using WebVue as a Java Web Start
application in parallel. This setting will override the index.html as default document.
Also this option is not compatible with embedding the JNLP file in your index.html (see below).

3.3 Using multiple WebVue projects in parallel


When accessing multiple WebVue projects in parallel it is recommendable to provide a strong
title in the jnlp-files of the individual projects:

<?xml version="1.0" encoding="UTF-8"?>


Title: Deploying WebVue via Java Web Start (JNLP)
Reference: <Ref to be updated>
Last modification: 14 April 2016 Page 18/30
<jnlp spec="1.0+" codebase="https://[hostname]:[port]/classes">

<information>
<title>WebDemo_en</title>
<vendor>Arc Informatique</vendor>
</information>

<resources>
<j2se version="1.7+" href="http://java.sun.com/products/autodl/j2se"/>
<jar href="AiWebVue-signed.jar" main="true" />
</resources>

<security>
<all-permissions/>
</security>

<applet-desc
documentBase="https://[hostname]:[port]/[PcVueProject]/"
name="WebVue"
main-class="svfc.launcher.WebVueClient"
width="1680"
height="1050" />

<update check="background"/>

</jnlp>

As a result multiple projects will get easier to manage from the Java Cache Viewer:

3.4 Passing parameters into WebVue


WebVue accepts several parameters that can be passed from the index.html file into the
WebVue applet.

Title: Deploying WebVue via Java Web Start (JNLP)


Reference: <Ref to be updated>
Last modification: 14 April 2016 Page 19/30
Normally this is achieved through the attributes-variable in the index.html file which looks the
following:

PcVue 11.0 and later:

PcVue 10.0 and earlier:

Obviously this option is not available when launching WebVue outside of the web browser
context.
When launching WebVue as a Java Web Start applet the following syntax can be used in the
JNLP file:

3.5 Embedding the link to the JNLP file in the


index.html
As an alternative to addressing the JNLP file directly on the web server, the JNLP file can also
be referenced from the index.html file.

The benefit of that is that you can still take advantage of the Java Deployment Toolkit which
has been used for the WebVue applet deployment since PcVue 11.0, and also that minimum
effort is required to only change the existing index.html file appropriately.

In particular, you will need to embed the link to the JNLP file in your own web page so that
WebVue can be included in a custom web portal.
Title: Deploying WebVue via Java Web Start (JNLP)
Reference: <Ref to be updated>
Last modification: 14 April 2016 Page 20/30
The Java Deployment Toolkit which is used to deploy WebVue since PcVue 11.0 can be easily
advised to directly download a JNLP file from a specific server address or to render a button on
the index.html file that allows users to download the JNLP file from the server and
consequently the WebVue application.

3.5.1 Directly launching the WebVue applet from code


In order to do so insert the following line into your web page and comment the rest of the
content inside the <SCRIPT>-tag:

deployJava.launch('webvue.jnlp');

Title: Deploying WebVue via Java Web Start (JNLP)


Reference: <Ref to be updated>
Last modification: 14 April 2016 Page 21/30
Title: Deploying WebVue via Java Web Start (JNLP)
Reference: <Ref to be updated>
Last modification: 14 April 2016 Page 22/30
Note:
Please note that you cannot set dynamic parameters for the WebVue applet in the way it was
possible when executing the WebVue applet in a web browser context.

3.5.2 Displaying a “Launch” button


If you do not want to launch WebVue automatically you may want to display a launcher button
instead.

In order to do so insert the following code into your web page and comment the rest of the
content inside the <SCRIPT>-tag:

deployJava.createWebStartLaunchButton('webvue.jnlp', '1.6.0');

Title: Deploying WebVue via Java Web Start (JNLP)


Reference: <Ref to be updated>
Last modification: 14 April 2016 Page 23/30
Title: Deploying WebVue via Java Web Start (JNLP)
Reference: <Ref to be updated>
Last modification: 14 April 2016 Page 24/30
After reloading the web page you can click the button “Launch” to launch WebVue as a Java
Web Start application:

Note:
Please note that you cannot set dynamic parameters for the WebVue applet in the way it was
possible when executing the WebVue applet in a web browser context.

Title: Deploying WebVue via Java Web Start (JNLP)


Reference: <Ref to be updated>
Last modification: 14 April 2016 Page 25/30
4 Limitations
4.1 Display, animations, viewers
Limitations in graphic rendering of mimics and user interactions are the same for WebVue
deployed using Java Web Start and deployed in the context of a web browser. See the online
help for more information.

4.2 Fullscreen mode


When launching the WebVue applet via Java Web Start the dimensions of the application
window must be specified in the JNLP file by pixel values. In contrast to launching WebVue in a
web browser context it is not possible to set the height and width parameters to relative
values, such as 100%.

4.3 Security
HTTP and HTTPS are both supported. For the configuration of SSL/TLS encryption please refer
to the PcVue documentation (PcVue 11.1) or the Knowledge Base (for earlier versions).

The WebVue applet needs to be signed.

4.4 Dynamic parameters / session sharing with WST


There is no simple way to pass dynamic parameters into the JNLP file. Therefore the option to
pass a previously generated WST session id to WebVue for the purpose of single-sign-on does
not exists with Java Web Start.

The only workaround for that would be to generate the JNLP file dynamically on the server side
according to parameters that are passed from the client, for example as URI arguments.

However, a description of how to achieve that is out of the scope of this article.

Title: Deploying WebVue via Java Web Start (JNLP)


Reference: <Ref to be updated>
Last modification: 14 April 2016 Page 26/30
5 FAQ
For a FAQ site about Java Web Start, please refer to
http://docs.oracle.com/javase/7/docs/technotes/guides/javaws/developersguide/faq.html

Title: Deploying WebVue via Java Web Start (JNLP)


Reference: <Ref to be updated>
Last modification: 14 April 2016 Page 27/30
6 Addendum
6.1 Alternative syntax for deploying WebVue as a Java
Web Start Application
For the sake of completeness please find hereby also an example of deploying WebVue as Java
Web Start application. This example is added because deploying WebVue as an application was
promoted in earlier versions of this documents. However, usage of this syntax is not
recommended since it imposes several severe operational limitations to Webvue.

<?xml version="1.0" encoding="UTF-8"?>


<jnlp spec="1.0+" codebase="https://[hostname]:[port]/classes">

<information>
<title>WebVue</title>
<vendor>Arc Informatique</vendor>
</information>

<resources>
<j2se version="1.7+" href="http://java.sun.com/products/autodl/j2se"/>
<jar href="AiWebVue-signed.jar" main="true" />
</resources>

<security>
<all-permissions/>
</security>

<application-desc name="WebVue" main-class="svfc.launcher.WebVueClient">


<argument>https://[hostname]:[port]/[PcVueProject]/</argument>
</application-desc>

<update check="background"/>

</jnlp>

Example:

Title: Deploying WebVue via Java Web Start (JNLP)


Reference: <Ref to be updated>
Last modification: 14 April 2016 Page 28/30
If running WebVue as a Java Web Start application several additional limitation apply:

Parameters

In theory, when launching WebVue as a Java Web Start application the parameters can be
passed through the JNLP file:

Currently passing parameters from the JNLP file into WebVue when launching WebVue as a
Java Web Start application does not seem to work. The reason for that needs to be evaluated
and the issue corrected. An SPR has been generated for that purpose: #61365.

SCADA Basic

The following verbs are not supported when launched as Java Web Start application:
- CONNECTURL
- LIST

Title: Deploying WebVue via Java Web Start (JNLP)


Reference: <Ref to be updated>
Last modification: 14 April 2016 Page 29/30
The only disadvantage of running WebVue as a Java Web Start applet is that the size of the
applet must be explicitly set in the JNLP file.

Title: Deploying WebVue via Java Web Start (JNLP)


Reference: <Ref to be updated>
Last modification: 14 April 2016 Page 30/30

You might also like