< 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).
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 and start up configuration files available for Unix and Windows environments
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.
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

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

JBoss Application Server 7 Configurations

Standalone Server Configurations
  • standalone.xml (default)
    • Java Enterprise Edition 6 certified web profile configuration which includes the technologies required by the Web Profile specification plus Java Connector 1.6 Architecture, Java XML API for RESTFul Web Services, and OSGi
  • standalone-preview.xml
    • referred to as our Java Enterprise Edition 6 full profile preview, this configuration contains all the technologies in the default configuration with additional technology previews of Java API for XML-Based Web Services (JAX-WS) 2.2 and Java Message Service 1.1.
  • standalone-ha.xml
    • default profile with Clustering capabilities
  • standalone-preview-ha.xml
    • EE 6 full profile preview with Clustering capabilities
Domain Server Configurations
  • domain.xml (default)
    • Java EE 6 certified Web Profile (include configuration for the technologies required by the Web Profile specification plus Java Connector 1.6 Architecture, Java XML API for RESTFul Web Services, and OSGi
  • domain-preview.xml
    • Includes configuration for default plus technology previews of JAX-WS and Java Message Service

Important to note is that the domain and standalone modes determine how the servers are managed not what capabilities they provide.
NOTE: The *-preview.xml configurations are only available in the Full Profile preview distributions.

Starting JBoss Application Server 7

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

To start the default web 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 web profile with additional EE 6 preview technologies, use the following syntax from $JBOSS_HOME/bin:

For domain mode:

You can also select one of the Clustering configurations provided. 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

Adminstration 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 http-interface port 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.

Command-Line Interface

If you prefer to manage your server from the command line (or batching), the jboss-admin.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.
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 a JDBC driver 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

**Note: The XML configuration should be used. The log manager properties are ignored after the logging subsystem is started.
JBoss Application Server 7 logging can be configured in the XML configuration files and the log manager properties file. The default logging configuration is located in the logging.properties file located in the configuration directory. For example, the standalone configuration file is under $JBOSS_HOME/standalone/configuration/logging.properties.
In general the defaults in the logging.properties configuration should be sufficient for most installs. If you require custom logging categories it's suggested they be configured in your XML configuration file, e.g. standalone.xml.
XML Configuration:
The XML configuration is defined in the standalone.xml file or the domain.xml configuration files, under the profile section in the logging subsystem. This is the preferred method to configure your custom logging categories.
There are 7 main types that can be defined:

  1. <root-logger />
  2. <logger category="" />
  3. <console-handler />
  4. <file-handler />
  5. <periodic-rotating-file-handler />
  6. <size-rotating-file-handler />
  7. <async-handler />

The root-logger defines the base settings for the other loggers to inherit by default.
See logging configuration for more details. The schema definition is located in $JBOSS_HOME/docs/schema/jboss-logging.xsd if you wish to see all the options.
The follow example shows how you could configure a logger for the category "org.jboss.as.quickstart.kitchensink" to a debug level.

The above example inherits the handlers from the <root-logger />. This can be overridden by adding the use-parent-handlers with a value of false to the <logger /> tag.
The advantage to using this method the level is easily changeable for the management console. This makes it very easy to turn on or off debugging for applications with no restart required.
Log Manager Properties:
The log manager configuration files is defined in the logging.properties file located in the configuration directory. For example, the standalone configuration file is under $JBOSS_HOME/standalone/configuration/logging.properties. This is only used as a bootstrap logger and does not support updates at runtime. The following properties may be specified in logging.properties:
Logger options

  • loggers=<category>[,<category>,...] - Specify a comma-separated list of logger categories which will be configured. Any categories not listed here will not be configured from the following properties.
  • logger.<category>.level=<level> - Specify the level for a category. The level can be a JDK logging level (SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST), a JBoss Logging 3 style level (FATAL, ERROR, WARN, INFO, DEBUG, TRACE), or a special level (OFF, ALL).
  • logger.<category>.handlers=<handler>[,<handler>,...] - Specify a comma-separated list of the names of handlers to attach to this logger. The handlers must be configured in the same properties file.
  • logger.<category>.filter=<filter> - Specify a filter for a category. The filter must be configured in the same properties file.
  • logger.<category>.useParentHandlers=(true|false) - Specify whether log messages should cascade up to parent handlers. The default value is true.

Handler options

  • handler.<name>=<className> - (Required) Specify the class name of the handler to instantiate.
  • handler.<name>.level=<level> - Restrict the level of this handler. If unspecified, the default value of ALL is retained.
  • handler.<name>.encoding=<encoding> - Specify the character encoding, if it is supported by this handler type. If not specified, a handler-specific default is used.
  • handler.<name>.errorManager=<name> - Specify the name of the error manager to use. The error manager must be configured in the same properties file. If unspecified, no error manager is configured.
  • handler.<name>.filter=<name> - Specify the name of the filter to use. The filter must be configured in the same properties file. If unspecified, messages are not filtered.
  • handler.<name>.formatter=<name> - Specify the name of the formatter to use, if it is supported by this handler type. The formatter must be configured in the same properties file. If not specified, messages will not be logged for most handler types.
  • handler.<name>.properties=<property>[,<property>,...] - Specify a list of JavaBean-style properties to additionally configure. A rudimentary type introspection is done to ascertain the appropriate conversion for the given property.
  • handler.<name>.<property>=<value> - Set the value of the named property.

Error manager options

  • errorManager.<name>=<className> - (Required) Specify the class name of the error manager to instantiate.
  • errorManager.<name>.properties=<property>[,<property>,...] - Specify a list of JavaBean-style properties to additionally configure. A rudimentary type introspection is done to ascertain the appropriate conversion for the given property.
  • errorManager.<name>.<property>=<value> - Set the value of the named property.

Formatter options

  • formatter.<name>=<className> - (Required) Specify the class name of the formatter to instantiate.
  • formatter.<name>.properties=<property>[,<property>,...] - Specify a list of JavaBean-style properties to additionally configure. A rudimentary type introspection is done to ascertain the appropriate conversion for the given property.
  • formatter.<name>.<property>=<value> - Set the value of the named property.

Filter options

  • filter.<name>=<className> - (Required) Specify the class name of the filter to instantiate.
  • filter.<name>.properties=<property>[,<property>,...] - Specify a list of JavaBean-style properties to additionally configure. A rudimentary type introspection is done to ascertain the appropriate conversion for the given property.
  • filter.<name>.<property>=<value> - Set the value of the named property.

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:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.