< Previous | Front page | Next >
Skip to end of metadata
Go to start of metadata

Getting Started with JBoss Application Server 7

JBoss Application Server 7 is the latest release in a series of JBoss application server offerings. JBoss Application Server 7, is a fast, powerful, implementation of the Java Enterprise Edition 6 specification. The state-of-the-art architecture built on the Modular Service Container enables services on-demand when your application requires them.   JBoss Application Server 7.0.0.Final release is a certified implementation of the Java Enterprise Edition 6 Web Profile specification.   The table below lists the Java Enterprise Edition 6 technologies and what is provided in our JBoss Application Server 7.0.0.Final release distributions.

*PRUNED (Refer to the Java Enterprise Edition 6 Platform Specification, EE.6.1.3 Pruned Java Technologies for an overview of this concept).

Missing HornetQ and JMS?
The JBoss AS Web Profile doesn't include JMS (provided by HornetQ) by default, so if you want to use messaging, make sure you have the "Full Profile" distribution of JBoss AS.

This document provides a quick overview on how to download and get started using JBoss Application Server 7 for your application development.  For in-depth content on administrative features, refer to the JBoss Application Server 7 Admin Guide.

Download

JBoss Application Server 7 distributions can be obtained from the usual place:

http://www.jboss.org/jbossas/downloads

Starting with JBoss Application Server 7.0.0.Final, there will be two distributions available for download available in zip or tar file formats.

  • Java EE 6 Full Profile Preview
    • jboss-as-7.0.0.Final.zip
    • jboss-as-7.0.0.Final.tar.gz
  • Java EE 6 Certified Web Profile
    • jboss-as-web-7.0.0.Final.zip
    • jboss-as-web-7.0.0.Final.tar.gz

Requirements

  • Java SE 6 or later (we recommend that you use the latest update available)
    Java SE 7 can be used with JBoss AS 7

Installation

Simply extract your chosen download to the directory of your choice. You can install JBoss Application Server 7 on any operating system that supports the zip or tar formats. Refer to the Release Notes for additional information related to the release.

AS 7 - A Quick Tour

Now that you’ve downloaded JBoss Application Server 7, the next thing to discuss is the layout of the distribution and explore the server directory structure, key configuration files, log files, user deployments and so on. It’s worth familiarizing yourself with the layout so that you’ll be able to find your way around when it comes to deploying your own applications.

AS 7 Directory Structure

DIRECTORY
DESCRIPTION
bin
Start up scripts, start up configuration files and various command line utilities like Vault, add-user and Java diagnostic report 
available for Unix and Windows environments
bin/client
Contains a client jar for use by non-maven based clients.
bundles
Location of OSGi bundles
docs/schema
XML schema definition files
domain
Configuration files, deployment content, and writable areas used by the domain mode processes run from this installation.
modules
AS 7 is based on a modular classloading architecture. The various modules used in the server are stored here.
standalone
Configuration files, deployment content, and writable areas used by the single standalone server run from this installation.
appclient Configuration files, deployment content, and writable areas used by the application client container run from this installation.
welcome-content
Default Welcome Page content

Standalone Directory Structure

In "standalone" mode each JBoss Application Server 7 instance is an independent process (similar to previous JBoss AS versions; e.g.,  3, 4, 5, or 6). The configuration files, deployment content and writable areas used by the single standalone server run from a JBoss Application Server installation are found in the following subdirectories under the top level "standalone" directory:

DIRECTORY
DESCRIPTION
configuration
Configuration files for the standalone server that runs off of this installation. All configuration information for the running server is located here and is the single place for configuration modifications for the standalone server.
data
Persistent information written by the server to survive a restart of the server
deployments
End user deployment content can be placed in this directory for automatic detection and deployment of that content into the server's runtime. 
NOTE: The server's management API is recommended for installing deployment content. File system based deployment scanning capabilities remain for developer convenience.
lib/ext
Location for installed library jars referenced by applications using the Extension-List mechanism
log
standalone server log files
tmp
location for temporary files written by the server
tmp/auth
Special location used to exchange authentication tokens with local clients so they can confirm that they are local to the running AS process.

Domain Directory Structure

A key feature of AS 7 is the managing multiple servers from a single control point.    A collection of multiple servers are referred to as a "domain". Domains can span multiple physical (or virtual) machines with all JBoss Application Server 7 instances on a given host under the control of a Host Controller process. The Host Controllers interact with the Domain Controller to control the lifecycle of the JBoss Application Server 7 instances running on that host and to assist the Domain Controller in managing them. The configuration files, deployment content and writeable areas used by domain mode processes run from a JBoss Application Server 7 installation are found in the following subdirectories under the top level "domain" directory:

DIRECTORY
DESCRIPTION
configuration
Configuration files for the domain and for the Host Controller and any servers running off of this installation. All configuration information for the servers managed wtihin the domain is located here and is the single place for configuration information.
content
an internal working area for the Host Controller that controls this installation. This is where it internally stores deployment content. This directory is not meant to be manipulated by end users.
Note that "domain" mode does not support deploying content based on scanning a file system.
lib/ext
Location for installed library jars referenced by applications using the Extension-List mechanism
log
Location where the Host Controller process writes its logs. The Process Controller, a small lightweight process that actually spawns the other Host Controller process and any Application Server processes also writes a log here.
servers
Writable area used by each Application Server instance that runs from this installation. Each Application Server instance will have its own subdirectory, created when the server is first started. In each server's subdirectory there will be the following subdirectories:
data -- information written by the server that needs to survive a restart of the server
log -- the server's log files
tmp -- location for temporary files written by the server
tmp
location for temporary files written by the server
tmp/auth
Special location used to exchange authentication tokens with local clients so they can confirm that they are local to the running AS process.

JBoss Application Server 7 Configurations

Standalone Server Configurations
  • standalone.xml (default)
    • Java Enterprise Edition 6 full profile certified configuration which includes the technologies required by the Full Profile specification plus others including OSGi 
  • standalone-ha.xml
    • Java Enterprise Edition 6 certified full profile configuration with high availability
  • standalone-osgi-only.xml
    • OSGi only standalone server. No JEE6  capabilities
  • standalone-xts.xml
    • Standalone JEE6 full certified profile with support for transactional web services.
Domain Server Configurations
  • domain.xml (default)
    • Java Enterprise Edition 6 full profile certified configuration which includes the technologies required by the Full Profile specification plus others including OSGi
  • domain-osgi-only.xml
    • OSGi only server. No JEE6  capabilities

Important to note is that the domain and standalone modes determine how the servers are managed not what capabilities they provide.

Starting JBoss Application Server 7

To start AS 7 using the default full profile configuration in "standalone" mode, change directory to $JBOSS_HOME/bin.

To start the default full profile configuration using domain management capabilities,

Starting JBoss Application Server 7 with an Alternate Configuration

If you choose to start your server with one of the other provided configurations, they can be accessed by passing the --server-config argument with the server-config file to be used. 

To use the full profile with clustering capabilities, use the following syntax from $JBOSS_HOME/bin:

Similarly to run OSGi only server in  domain mode:

 Alternatively, you can create your own selecting the additional subsystems you want to add, remove, or modify.

Test Your Installation

After executing one of the above commands, you should see output similar to what's shown below.

As with previous JBoss releases, you can point your browser to http://localhost:8080 (if using the default configured http port) which brings you to the Welcome Screen:

From here you can access links to the AS 7 community documentation set, stay up-to-date on the latest project information, have a discussion in the user forum and access the newly designed web-based Administration Console.  Or, if you uncover an issue while using AS 7, report an issue to inform us (attached patches will be reviewed).  This landing page is recommended for convenient access to information about AS 7 but can easily be replaced with your own if desired.

Managing your JBoss Application Server 7

AS 7 offers two administrative mechanisms for managing your running instance: 

  • web-based Administration Console
  • command-line interface

Authentication

By default JBoss AS 7 is now distributed with security enabled for the management interfaces, this means that before you connect using the administration console or remotely using the CLI you will need to add a new user, this can be achieved simply by using the add-user.sh script in the bin folder.

After starting the script you will be guided through the process to add a new user: -

In this case a new user is being added for the purpose of managing the servers so select option a.

You will then be prompted to enter the details of the new user being added: -

It is important to leave the name of the realm as 'ManagementRealm' as this needs to match the name used in the server's configuration, for the remaining fields enter the new username, password and password confirmation.

Provided there are no errors in the values entered you will then be asked to confirm that you want to add the user, the user will be written to the properties files used for authentication and a confirmation message will be displayed.

The modified time of the properties files are inspected at the time of authentication and the files reloaded if they have changed, for this reason you do not need to re-start the server after adding a new user.

Administration Console

To access the web-based Administration Console, simply follow the link from the Welcome Screen.  To directly access the Management Console, point your browser at:

http://localhost:9990/console

NOTE:   port 9990 is the default port configured.  

If you modify the management-http socket binding in your running configuration: adjust the above command accordingly.    If such modifications are made, then the link from the Welcome Screen will also be inaccessible.

If you have not yet added at least one management user an error page will be displayed asking you to add a new user, after a user has been added you can click on the 'Try Again' link at the bottom of the error page to try connecting to the administration console again.

Command-Line Interface

If you prefer to manage your server from the command line (or batching), the jboss-cli.sh script provides the same capabilities available via the web-based UI.  This script is accessed from $JBOSS_HOME/bin directory; e.g.,

Notice if no host or port information provided, it will default to localhost:9999.

When running locally to the JBoss AS process the CLI will silently authenticate against the server by exchanging tokens on the file system, the purpose of this exchange is to verify that the client does have access to the local file system.  If the CLI is connecting to a remote AS7 installation then you will be prompted to enter the username and password of a user already added to the realm.

Once connected you can add, modify, remove resources and deploy or undeploy applications.  For a complete list of commands and command syntax, type help once connected.

5 Ways to Deploy your Application to JBoss AS 7
Check out this video showing step-by-step options for deploying your application to JBoss Application Server 7

Modifying the Example DataSource

As with previous JBoss application server releases, a default data source, ExampleDS, is configured using the embedded H2 database for developer convenience.  There are two ways to define datasource configurations:

  1. as a module
  2. as a deployment

In the provided configurations, H2 is configured as a module.  The module is located in the $JBOSS_HOME/modules/com/h2database/h2 directory.  The H2 datasource configuration is shown below.

The datasource subsystem is provided by the IronJacamar project. For a detailed description of the available configuration properties, please consult the project documentation.

Configure Logging in JBoss Application Server 7

JBoss Application Server 7 logging can be configured in the XML configuration files, the web console or the command line interface. You can get more detail on the Logging Configuration page.

Turn on debugging for a specific category:

By default the server.log is configured to include all levels in it's log output. In the above example we changed the console to also display debug messages.

All JBoss AS 7 documentation

There are several guides in the JBoss Application Server 7 documentation series. This list gives an overview of each of the guides:

*Getting Started Guide - Explains how to download and start JBoss Application Server 7.
*Getting Started Developing Applications Guide - Talks you through developing your first applications on JBoss Application Server 7, and introduces you to JBoss Tools and how to deploy your applications.
*JavaEE 6 Tutorial - A Java EE 6 Tutorial.
*Admin Guide - Tells you how to configure and manage your JBoss Application Server 7 instances.
*Developer Guide - Contains concepts that you need to be aware of when developing applications for JBoss Application Server 7. Classloading is explained in depth.
*High Availability Guide - Reference guide for how to set up clustered JBoss Application Server 7 instances.
*Extending JBoss AS 7 - A guide to adding new functionality to JBoss Application Server 7.

Labels:
jboss jboss Delete
as7 as7 Delete
getting_started getting_started Delete
s s Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. May 04, 2012

    In my opinion there are missing some important parts about configuring Java.

    First of all I found out that JBoss AS7 runs on Java 64-bit. So if there's a 64-bit JDK installed no need to download and install a 32-bit Java version.

    You don't need to setup an environment variable JAVA_HOME. Use the config files to configure the Java installation directory.

    If you run AS7 on Windows and the path to your Java installation contains spaces you'll run into issues if you put the path into quotes. So don't use quotes! For example write set JAVA_HOME=C:/Program Files/Java/jdk1.7.0_02 into your standalone.conf.bat.

    Hope this helps!