JBoss Application Server
by, 11-26-2011 at 06:35 PM (1101 Views)
Talking about J2EE application servers, JBOSS is a popular choice. The reason is that JBOSS is open-source EJB solution with lot of impressive features that are missing in Weblogic, WebSphere, and the other big players.
Some of the interesting features provided by JBOSS are:
- enterprise-class security
- transaction support
- resource management
- load balancing
- database connection pooling
- JavaMail support
JBOSS is a container for the following:
- EJB (Entity Beans, Session Beans, and Message Driven Beans)
- Web Services
JBoss Application Server ships with Apache Tomcat for the web tier, Hypersonic for embedded database services, and Hibernate for object-relational mapping.
The first step is to download and install the server. I would prefer JVM 1.5 but you can use older versions as well but it should be 1.3+ version of JVM.
Download the latest stable version of the JBoss distribution at http://www.jboss.org/.
Unzip the compressed file into the desired directory. Note: An installation directory (JBoss-x.x.x/) will be created there.
Now you have to create an environment variable (variable name: JBOSS_DIST) pointing to the location of the JBoss directory (variable value: path_to_jboss).
Setting environment variable in Windows NT/2000/XP is simple and is discussed in the next post.
Follow the following steps to set environment variable:
- Open Control Panel
- Click the System icon
- Go to the Advanced pane
- Click the Environment Variables button
- There are two separated windows showing two sets of environment variables. Select the "new" button for the upper window to create a new environment variable.
- Select the "Edit" button for the upper window to edit an existing environment variable.
Now test the installation by executing the run script from the /bin directory.
When you start the server up, you will see a bunch of output from the script giving you more information than you could ever want about exactly what is going on with JBoss. Several screens of text will scroll past you. No need to worry as this is normal. How will you know that everything is ok or not. The answer is that at the end, if you see a single line indicating that the JBoss server started in a certain number of seconds, it means all is fine and server has started. Also see if any exception was thrown.
Enterprise beans are packaged in a JAR file (Java ARchive) with the appropriate XML files in the META-INF folder. Most J2EE app servers require the deployment of an EJB JAR within a WAR (Web ARchive) file, and even within an EAR file (Enterprise ARchive). The process of packaging up an enterprise bean with deployment descriptors into a larger archive with its deployment descriptors can become rather complex. This process may be necessary in a production environment, but in development, you need quick, efficient deployment. JBoss provides the best of both worlds.
In order to deploy EJBs in JBoss, simply drop the archive into the deploy directory. The JBoss engine immediately inspects the contents of the archive and attempts to deploy the beans. To undeploy, simply delete the archive from the deploy directory.
Following features make deployment process highly efficient with JBoss:
- supports the deployment of EJB JARs contained within WARs and EARs
- supports the native deployment of EJB JARs
- does not require the inclusion of the server-specific XML file unless specific changes are made