March 3, 2021
Hot Topics:

Deploying Java Web Start Applications on the JBoss Application Server

  • By Olexiy & Alexander Prokhorenko
  • Send Email »
  • More Articles »

Configuring JNLP Protocol Support on JBoss

As it was mentioned in the beginning of the article, we are using JBoss 3.2.3 with the included Apache Tomcat Web container. It's worth specifying that once we launch JBoss server in the default configuration, and the server is located in the C:\jboss-3.2.3 directory, so all deployment executes into the C:\jboss-3.2.3\server\default\deploy\ directory.

To configure, we need to describe new MIME-types in the web.xml file. As you should know, this file is going with every Java application and describes all configurations done to your application. If you want these configurations to be applied to all your applications on the JBoss server, you must do the following changes in the "global" web.xml file, located (in my case) in the C:\jboss-3.2.3\server\default\deploy\jbossweb-tomcat41.sar\ directory.

The changes are the following:


Creating Your Own WAR Application for JBoss

Now the time has come to gather up and to build our Java Web Start application. We won't create a working application because it's not the aim of this article. Our task is to get to know how to install Java Web Start applications on a JBoss server.

The directory tree of our WAR package is given below:


The contents of the main files that you must create yourself are the following:


package demo.green.client;

public class DemoTest {
   public static void main(String[] a) {

The next command compiles our DemoTest.java code.

javac DemoTest.java

It doesn't do anything; it simply executes. It has the required main() method for this purpose.


<head><title>Demo Test of Java Web Start</title></head>
<body><center><a href="demotest.jnlp">Click Me!</a></center></body>


<?xml version="1.0" encoding="ISO-8859-1"?>
<jnlp spec="1.0+" codebase="http://localhost:8080/jwsdemo"
      <title>Demo Test</title>
      <description>Demo client by Green</description>
      <j2se version="1.3+" />
      <jar href="demotest.jar" main="true" />
   <application-desc main-class="demo.green.client.DemoTest" />

The deploy.bat file is used to compile, assemble, and deploy everything mentioned above.

@echo off
set JBOSS_DIR=C:\jboss-3.2.3
jar cfv demotest.jar demo/
jar cfv jwsdemo.war WEB-INF/ index.html *.jar demotest.jnlp
copy jwsdemo.war %JBOSS_DIR%\server\default\deploy\

In principle, this is all that is required. After launching deploy.bat in your browser, you need to open http://localhost:8080/jwsdemo, click the Click Me! link, and your Java Web Start will be launched automatically. It will install your Java application (of course, it will download all required resources and libraries) and that's all. With the next launch, Java Web Start will offer to create a shortcut on your desktop, to access this application without a Web browser.

If everything was done correctly when launching the Java Web Start application, you see this dialog window:

If you execute Java Web Start Application Manager, you will see your Java application installed in it:

Now, you may try to create your own real Java applications and install them with the help of Java Web Start. Finally, we should like to mention about the moment of automatic updating your application. If you changed your application or simply added some libraries, you must simply deploy your WAR package on the JBoss server, and once your application is be launched on the client's PC, all the changes and updates will be downloaded and installed. It is very simple!

Page 2 of 2

This article was originally published on April 22, 2004

Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

Thanks for your registration, follow us on our social networks to keep up-to-date