gamelan
Search EarthWeb
CodeGuru | Gamelan | Jars | Wireless | Discussions
Navigate developer.com
Architecture & Design  
Database  
Java
Languages & Tools
Microsoft & .NET
Open Source  
Project Management  
Security  
Techniques  
Voice  
Web Services  
Wireless/Mobile
XML  
Technology Jobs  

   Developer.com Webcasts:
  The Impact of Coding Standards and Code Reviews

  Project Management for the Developer

  Defining Your Own Software Development Methodology

  more Webcasts...




See the Winners!


Linked Data Planet Conference & Expo


Developer Jobs

Be a Commerce Partner
Compare Prices
Shop
Find Software
Prepaid Phone Card
Car Donations
Dental Insurance
Disney World Tickets
Send Text Messages
Promos and Premiums
Free Business Cards
Best Price
Online Education
KVM Switches
Promotional Golf

 


Download these IBM resources today!
e-Kit: IBM Rational Systems Development Solution
With systems teams under so much pressure to develop products faster, reduce production costs, and react to changing business needs quickly, communication and collaboration seem to get lost. Now, theres a way to improve product quality and communication.

Webcast: Asset Reuse Strategies for Success--Innovate Don't Duplicate!
Searching for, identifying, updating, using and deploying software assets can be a difficult challenge.

eKit: Rational Build Forge Express
Access valuable resources to help you increase staff productivity, compress development cycles and deliver better software, fast.

Download: IBM Data Studio v1.1
Effectively design, develop, deploy and manage your data, databases, and database applications throughout the data management life.

eKit: Rational Asset Manager
Learn how to do more with your reusable assets, learn how Rational Asset Manager tracks and audits your assets in order to utilize them for reuse.
Developer News -
SaaS Tool Offers Custom Database Development    May 9, 2008
Microsoft’s Automated Agent: Can We Talk?    May 7, 2008
Borland Finally Sells CodeGear    May 7, 2008
Red Hat Heads For The JON 2.0    May 7, 2008
Free Tech Newsletter -

Best Practices for Developing a Web Site: Checklists, Tips, Strategies & More. Download Exclusive eBook Now.

Deploying Java Web Start Applications on the JBoss Application Server
By Olexiy & Alexander Prokhorenko

Go to page: Prev  1  2  

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:

...
<mime-mapping>
    <extension>jnlp</extension>
    <mime-type>application/x-java-jnlp-file</mime-type>
</mime-mapping>
<mime-mapping>
    <extension>jar</extension>
    <mime-type>application/x-java-archive</mime-type>
</mime-mapping>
<mime-mapping>
    <extension>jardiff</extension>
    <mime-type>application/x-java-archive-diff</mime-type>
</mime-mapping>
...

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:

demo\green\client\DemoTest.java
demo\green\client\DemoTest.class
WEB-INF\lib\jardiff.jar
WEB-INF\lib\jnlp.jar
WEB-INF\lib\jnlp-servlet.jar
WEB-INF\web.xml
deploy.bat
index.html
demotest.jar
demotest.jnlp

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

demo\green\client\DemoTest.java

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.

index.html

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

demotest.jnlp

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

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!

Go to page: Prev  1  2  


Tools:
Add www.developer.com to your favorites
Add www.developer.com to your browser search box
IE 7 | Firefox 2.0 | Firefox 1.5.x
Receive news via our XML/RSS feed


Enterprise Java Archives

Whitepaper: Enterprise Information Integration--Deployment Best Practices for Low-Cost Implementation
Five Trends for Application Development & Program Management. Download Complimentary Report Now.
Data Sheet: IBM Information Server Blade
Is it time to make your move to the multi-threaded and parallel processing world? Find out!
Generate Complete .NET Web Apps in Minutes . Download Iron Speed Designer today.



JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
Microsoft Article: Will Hyper-V Make VMware This Decade's Netscape?
Microsoft Article: 7.0, Microsoft's Lucky Version?
Microsoft Article: Hyper-V--The Killer Feature in Windows Server 2008
Avaya Article: How to Feed Data into the Avaya Event Processor
Microsoft Article: Install What You Need with Windows Server 2008
HP eBook: Putting the Green into IT
Whitepaper: HP Integrated Citrix XenServer for HP ProLiant Servers
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 1
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 2--The Future of Concurrency
Avaya Article: Setting Up a SIP A/S Development Environment
IBM Article: How Cool Is Your Data Center?
Microsoft Article: Managing Virtual Machines with Microsoft System Center
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Intel Video: Are Multi-core Processors Here to Stay?
On-Demand Webcast: Five Virtualization Trends to Watch
HP Video: Page Cost Calculator
Intel Video: APIs for Parallel Programming
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Sun Download: Solaris 8 Migration Assistant
Sybase Download: SQL Anywhere Developer Edition
Red Gate Download: SQL Backup Pro and free DBA Best Practices eBook
Red Gate Download: SQL Compare Pro 6
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
How-to-Article: Preparing for Hyper-Threading Technology and Dual Core Technology
eTouch PDF: Conquering the Tyranny of E-Mail and Word Processors
IBM Article: Collaborating in the High-Performance Workplace
HP Demo: StorageWorks EVA4400
Intel Featured Algorhythm: Intel Threading Building Blocks--The Pipeline Class
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES