Getting Started Guide - JBoss AS 7.0 (2024)

  • Prev
  • Next
  • Getting Started with JBoss Application Server 7

    • Download

    • Requirements

    • Installation

    • AS 7 - A Quick Tour

      • AS 7 Directory Structure

      • JBoss Application Server 7 Configurations

      • Starting JBoss Application Server 7

      • Starting JBoss Application Server 7 with an Alternate Configuration

      • Managing your JBoss Application Server 7

      • Modifying the Example DataSource

  • All JBoss AS 7 documentation

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.
Getting Started Guide - JBoss AS 7.0 (1)
*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.

./standalone.sh

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

./domain.sh

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:

./standalone.sh --server-config=standalone-preview.xml

For domain mode:

./domain.sh --domain-config=domain-preview.xml

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.

========================================================================= JBoss Bootstrap Environment JBOSS_HOME: /work/jboss-as-7.0.0.Final JAVA: /usr/jdk1.6/bin/java JAVA_OPTS: -server -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman=========================================================================16:32:05,050 INFO [org.jboss.modules] JBoss Modules version 1.0.1.GA16:32:05,379 INFO [org.jboss.msc] JBoss MSC version 1.0.0.GA16:32:05,421 INFO [org.jboss.as] JBoss AS 7.0.0.Final "Lightning" starting<snip>16:32:07,578 INFO [org.jboss.as] (Controller Boot Thread) JBoss AS 7.0.0.Final "Lightning" started in 2804ms - Started 91 of 146 services (55 services are passive or on-demand)

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:
Getting Started Guide - JBoss AS 7.0 (2)
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:

<management-interfaces> <native-interface interface="management" port="9999" /> <http-interface interface="management" port="9990"/></management-interfaces>

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.,

cd $JBOSS_HOME/bin./jboss-admin.sh --connectConnected to standalone controller at localhost:9999

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.

<subsystem xmlns="urn:jboss:domain:datasources:1.0"> <datasources> <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS"> <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</connection-url> <driver>h2</driver> <pool> <min-pool-size>10</min-pool-size> <max-pool-size>20</max-pool-size> <prefill>true</prefill> </pool> <security> <user-name>sa</user-name> <password>sa</password> </security> </datasource> <xa-datasourcejndi-name="java:jboss/datasources/ExampleXADS"pool-name="ExampleXADS"> <driver>h2</driver> <xa-datasource-propertyname="URL">jdbc:h2:mem:test</xa-datasource-property> <xa-pool> <min-pool-size>10</min-pool-size> <max-pool-size>20</max-pool-size> <prefill>true</prefill> </xa-pool> <security> <user-name>sa</user-name> <password>sa</password> </security> </xa-datasource> <drivers> <driver name="h2" module="com.h2database.h2"> <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class> </driver> </drivers> </datasources></subsystem>

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

  • IronJacamar homepage: http://www.jboss.org/ironjacamar

  • Project Documentation: http://www.jboss.org/ironjacamar/docs

  • Schema description: http://docs.jboss.org/ironjacamar/userguide/1.0/en-US/html/deployment.html#deployingds_descriptor

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.

<logger category="org.jboss.as.quickstart.kitchensink"> <level name="DEBUG"/></logger>

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.

  • PrevJavaEE 6 Tutorial
  • Top of page
  • Front page
  • NextGlossary

JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-13 13:20:06 UTC, last content change 2014-04-24 08:46:19 UTC.

Getting Started Guide - JBoss AS 7.0 (2024)
Top Articles
Latest Posts
Article information

Author: Virgilio Hermann JD

Last Updated:

Views: 5787

Rating: 4 / 5 (41 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Virgilio Hermann JD

Birthday: 1997-12-21

Address: 6946 Schoen Cove, Sipesshire, MO 55944

Phone: +3763365785260

Job: Accounting Engineer

Hobby: Web surfing, Rafting, Dowsing, Stand-up comedy, Ghost hunting, Swimming, Amateur radio

Introduction: My name is Virgilio Hermann JD, I am a fine, gifted, beautiful, encouraging, kind, talented, zealous person who loves writing and wants to share my knowledge and understanding with you.