JBoss RichFaces 3.3 Supplemental Installation

Exclusive offer: get 50% off this eBook here
JBoss RichFaces 3.3

JBoss RichFaces 3.3 — Save 50%

Enhance your JSF web applications using powerful AJAX components

$23.99    $12.00
by Nirav Assar | February 2010 | JBoss Open Source

This article by Nirav Assar, is a supplement to the book JBoss RichFaces 3.3 by Demetrio Filocamo. The book offers a thorough explanation on how to effectively use RichFaces technology to enhance your enterprise applications. The book provides many code examples for the reader to experiment with and run on their local machine. It also provides some very important installation steps for developers such as the Seam Framework download, seam-gen tool operation, and Eclipse with JBoss tools. As a supplement to the book, this article provides a guide to install several other necessary components. The components will provide the user with a sufficient environment to deploy and test the examples provided in the book. These installations prove invaluable when trying to learn new technologies and can possibly avoid large amounts of time wasted searching for the correct path.

This article provides guidance for:

  • JBoss Server Installation
  • Starting JBoss Server within Eclipse
  • MySql Installation
  • Build and Deploy Example applications

This installation guide is for the Windows platform.

JBoss Server Installation

In order to run any web application, an application server is needed. JBoss server is an industry standard and is ideal for running Seam and RichFaces applications.  Downloading the server is a very simple task.

First go to the JBoss download page and download the 4.2.2.GA version of the JBoss server. Save it to a directory for downloads such as c:downloads.

Unzip the file to the c: directory.  After unzipping, you should have a folder named c: jboss-4.2.2.GA.

Test the server installation by going into c:jboss-4.2.2.GAbin and running the file run.bat. A command window should run with server logs. At completion, the logs will indicate that the server has started.

Starting JBoss Server Within Eclipse

Although you can start JBoss server from the run.bat file, for the purposes of development and learning RichFaces, it is more valuable to start the JBoss server within Eclipse. The Eclipse IDE provides support to run, shutdown and adjust settings for servers.

In Eclipse, we will work from the Java Perspective. Change Eclipse to be in the Java Perspective. Go to Window->Open Perspective->Java. We need to have a tab for Server. Go To Window->Show View->Other->Servers->Server.

In the Server tab, right click and go to New->Server. Here we are defining a server to launch within Eclipse. Choose JBoss->JBoss v4.2->Next. Choose the JRE, which will typically be the path to where Java is installed. For the Application Server Directory, choose c:jboss-4.2.2.GA then Next. Accept the defaults for Address, Port, JNDI Port and Server Configuration. Click Next->Finish.

Next the server settings need to be adjusted. Double click on the JBOSS 4.2 entry in the server tab to bring up the settings menu in eclipse. Click on the edit menu on the right hand side.

JBoss RichFaces 3.3 Supplemental Installation

Figure 1 - JBoss Server settings

Uncheck all check boxes and Server Timeout Delay to be Unlimited. The server is ready to run. In the Server tab, right click on the JBOSS 4.2 entry and choose Start. Go to the Console tab and you will see the server logs. At completion, the logs should indicate that the server has started.

MySql Installation

MySql is the database used to store information in the example applications. Once MySql is installed, the example applications can connect to a persistent store and the developer will be able to see data saved as the application is exercised.

Go to the MySql download page and retrieve the installation file. Look for MSI file labeled mysql-essential-5.1.42-winx64.msi (or a similar version). The MSI file is easiest to install as it gives a wizard to guide you through the process.

Once the file is saved, double click on it to initiate installation. Choose all the default options. When the id and password is requested, choose root as both the id and password. This is easy to remember for development purposes.

Verify installation of MySql by looking for the shortcuts placed Windows Programs Menu. Also verify that MySql has been installed as a Windows service. The easiest way to do this is to go to Start-> Run in Windows and type services.msc. The services dialogue box should have a MySql entry. Make sure the MySql service is started.

JBoss RichFaces 3.3 Supplemental Installation

Run MySql Command Client

In order to operate the MySql database, you can use the provided command line client. The client enables the user to look up tables, execute operational commands, and run sql statements.  In the Windows Start menu, go to Start->Programs0->MySql->MySql Server 5.x->MySql Command Line Client. Type in root for the password. A mysql prompt will appear.

The command line tool is used for creating the database for the example applications. In order to import a sql script, use the command source <path>. For example:

source c:\adv_contact_manager_create.sql

For a full list of commands for MySql, see the online manual: http://dev.mysql.com/doc/refman/5.1/en/index.html.

Download and Install MySql JDBC Connector

In order for Java applications to connect to MySql through JDBC, a connector jar is needed. MySql provides connectivity for client applications developed in the Java programming language via a JDBC driver, which is called MySql Connector/J.

Go to the connector download page and retrieve the zip file.

Unzip the file to a directory. Identify the file mysql-connector-java-5.1.10-bin.jar. Copy this file to the default server lib directory so that it is accessible by all applications:

C:jboss-4.2.2.GAserverdefaultlib

Build and Deploy Example Applications

In order to see the application that is being developed, it is necessary to build and deploy the application onto the server. Applications generated by the seam-gen tool come built with a script armed with many build tasks. Eclipse provides Ant support so we can use it to operate the build file provided within the example application.

In Eclipse with the application loaded as a project, open the Ant view. Go to Window-> Show View-> Ant. The Ant view will be displayed.

Now load the build.xml in order to operate the Ant targets. Right click in the Ant view and select Add Buildfiles->Choose build.xml for the application. A list of Ant targets will be loaded.

In order to execute a task, simply double click on the task. The Console window will display the executed statements. Seam-gen offers several tasks, but a notable few are very useful.

  • deploy – builds and deploys the application to the server
  • undeploy – deletes the application from the server
  • purge – deletes temporary server files associated with the application
  • clean – deletes package application files from the local distribution directory

If the deploy task fails, simply go to the JBoss deployment directory and delete the installed application.

C:jboss-4.2.2.GAserverdefaultdeploy

Applications can also be directly copied into this directory for deployment. Inversely, applications can be directly deleted from this directory for un-deployment.

With these basics installations complete, running the example applications should be simple and you will be on your way to mastering RichFaces 3.3.

Summary

In this article, we discussed the following:

  • JBoss Server Installation
  • Starting JBoss Server within Eclipse
  • MySql Installation
  • Build and Deploy Example applications
JBoss RichFaces 3.3 Enhance your JSF web applications using powerful AJAX components
Published: October 2009
eBook Price: $23.99
Book Price: $39.99
See more
Select your format and quantity:

About the Author :


Nirav Assar is an agile java consultant in the Dallas/Fort Worth area. His expertise includes helping software development teams adopt agile practices, as well as designing and implementing enterprise applications using the principles of object oriented design and clean code. Nirav has worked in a variety of industries including defense, retail, government, and real estate. Along the way, he has worked with many java technologies but his favorites include spring, seam, hibernate, cruisecontrol and ejb3.0. In his spare time, he also enjoys spending time with his family, discussing philosophy and playing soccer.

Books From Packt

GlassFish Security
GlassFish Security

NHibernate 2.x Beginner's Guide
NHibernate 2.x Beginner's Guide

Pentaho 3.2 Data Integration: Beginner's Guide
Pentaho 3.2 Data Integration: Beginner's Guide

JavaFX 1.2 Application Development Cookbook
JavaFX 1.2 Application Development Cookbook

NetBeans Platform 6.8 Developer's Guide
NetBeans Platform 6.8 Developer's Guide

Mahara 1.2 E-Portfolios: Beginner's Guide
Mahara 1.2 E-Portfolios: Beginner's Guide

AJAX and PHP: Building Modern Web Applications 2nd Edition
AJAX and PHP: Building Modern Web Applications 2nd Edition

Flex 3 with Java
Flex 3 with Java

Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Resources
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software