JBoss Enterprise Application Platform 6.3

Getting Started Guide

For Use with Red Hat JBoss Enterprise Application Platform 6

Nidhi Chaudhary

Lucas Costi

Russell Dickenson

Sande Gilda

Vikram Goyal

Eamon Logue

Darrin Mison

Scott Mumford

David Ryan

Misty Stanley-Jones

Keerat Verma

Tom Wells

Legal Notice

Copyright © 2014 Red Hat, Inc..

This document is licensed by Red Hat under the Creative Commons Attribution-ShareAlike 3.0 Unported License. If you distribute this document, or a modified version of it, you must provide attribution to Red Hat, Inc. and provide a link to the original. If the document is modified, all Red Hat trademarks must be removed.

Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.

Red Hat, Red Hat Enterprise Linux, the Shadowman logo, JBoss, MetaMatrix, Fedora, the Infinity Logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.

Linux® is the registered trademark of Linus Torvalds in the United States and other countries.

Java® is a registered trademark of Oracle and/or its affiliates.

XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.

MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.

Node.js® is an official trademark of Joyent. Red Hat Software Collections is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.

The OpenStack® Word Mark and OpenStack Logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.

All other trademarks are the property of their respective owners.

Abstract

This book provides the basic steps to get started with JBoss EAP 6.

Preface

1. Document Conventions

This manual uses several conventions to highlight certain words and phrases and draw attention to specific pieces of information.

In PDF and paper editions, this manual uses typefaces drawn from the Liberation Fonts set. The Liberation Fonts set is also used in HTML editions if the set is installed on your system. If not, alternative but equivalent typefaces are displayed. Note: Red Hat Enterprise Linux 5 and later include the Liberation Fonts set by default.

1.1. Typographic Conventions

Four typographic conventions are used to call attention to specific words and phrases. These conventions, and the circumstances they apply to, are as follows.

Mono-spaced Bold

Used to highlight system input, including shell commands, file names and paths. Also used to highlight keys and key combinations. For example:

To see the contents of the file my_next_bestselling_novel in your current working directory, enter the cat my_next_bestselling_novel command at the shell prompt and press Enter to execute the command.

The above includes a file name, a shell command and a key, all presented in mono-spaced bold and all distinguishable thanks to context.

Key combinations can be distinguished from an individual key by the plus sign that connects each part of a key combination. For example:

Press Enter to execute the command.

Press Ctrl+Alt+F2 to switch to a virtual terminal.

The first example highlights a particular key to press. The second example highlights a key combination: a set of three keys pressed simultaneously.

If source code is discussed, class names, methods, functions, variable names and returned values mentioned within a paragraph will be presented as above, in mono-spaced bold. For example:

File-related classes include filesystem for file systems, file for files, and dir for directories. Each class has its own associated set of permissions.

Proportional Bold

This denotes words or phrases encountered on a system, including application names; dialog-box text; labeled buttons; check-box and radio-button labels; menu titles and submenu titles. For example:

Choose System → Preferences → Mouse from the main menu bar to launch Mouse Preferences. In the Buttons tab, select the Left-handed mouse check box and click Close to switch the primary mouse button from the left to the right (making the mouse suitable for use in the left hand).

To insert a special character into a gedit file, choose Applications → Accessories → Character Map from the main menu bar. Next, choose Search → Find… from the Character Map menu bar, type the name of the character in the Search field and click Next. The character you sought will be highlighted in the Character Table. Double-click this highlighted character to place it in the Text to copy field and then click the Copy button. Now switch back to your document and choose Edit → Paste from the gedit menu bar.

The above text includes application names; system-wide menu names and items; application-specific menu names; and buttons and text found within a GUI interface, all presented in proportional bold and all distinguishable by context.

Mono-spaced Bold Italic or Proportional Bold Italic

Whether mono-spaced bold or proportional bold, the addition of italics indicates replaceable or variable text. Italics denotes text you do not input literally or displayed text that changes depending on circumstance. For example:

To connect to a remote machine using ssh, type ssh username@domain.name at a shell prompt. If the remote machine is example.com and your username on that machine is john, type ssh john@example.com.

The mount -o remount file-system command remounts the named file system. For example, to remount the /home file system, the command is mount -o remount /home.

To see the version of a currently installed package, use the rpm -q package command. It will return a result as follows: package-version-release.

Note the words in bold italics above: username, domain.name, file-system, package, version and release. Each word is a placeholder, either for text you enter when issuing a command or for text displayed by the system.

Aside from standard usage for presenting the title of a work, italics denotes the first use of a new and important term. For example:

Publican is a DocBook publishing system.

1.2. Pull-quote Conventions

Terminal output and source code listings are set off visually from the surrounding text.

Output sent to a terminal is set in mono-spaced roman and presented thus:

books        Desktop   documentation  drafts  mss    photos   stuff  svn

books_tests  Desktop1  downloads      images  notes  scripts  svgs

Source-code listings are also set in mono-spaced roman but add syntax highlighting as follows:

static int kvm_vm_ioctl_deassign_device(struct kvm *kvm,

struct kvm_assigned_pci_dev *assigned_dev)

{

int r = 0;

struct kvm_assigned_dev_kernel *match;

mutex_lock(&kvm->lock);

match = kvm_find_assigned_dev(&kvm->arch.assigned_dev_head,

assigned_dev->assigned_dev_id);

if (!match) {

printk(KERN_INFO "%s: device hasn't been assigned before, "

"so cannot be deassigned\n", __func__);

r = -EINVAL;

goto out;

}

kvm_deassign_device(kvm, match);

kvm_free_assigned_device(kvm, match);

out:

mutex_unlock(&kvm->lock);

return r;

}

1.3. Notes and Warnings

Finally, we use three visual styles to draw attention to information that might otherwise be overlooked.

Note

Notes are tips, shortcuts or alternative approaches to the task at hand. Ignoring a note should have no negative consequences, but you might miss out on a trick that makes your life easier.

Important

Important boxes detail things that are easily missed: configuration changes that only apply to the current session, or services that need restarting before an update will apply. Ignoring a box labeled “Important” will not cause data loss but may cause irritation and frustration.

Warning

Warnings should not be ignored. Ignoring warnings will most likely cause data loss.

2. Getting Help and Giving Feedback

2.1. Do You Need Help?

If you experience difficulty with a procedure described in this documentation, visit the Red Hat Customer Portal at http://access.redhat.com. Through the customer portal, you can:

- search or browse through a knowledgebase of technical support articles about Red Hat products.

- submit a support case to Red Hat Global Support Services (GSS).

- access other product documentation.

Red Hat also hosts a large number of electronic mailing lists for discussion of Red Hat software and technology. You can find a list of publicly available mailing lists at https://www.redhat.com/mailman/listinfo. Click on the name of any mailing list to subscribe to that list or to access the list archives.

2.2. We Need Feedback!

If you find a typographical error in this manual, or if you have thought of a way to make this manual better, we would love to hear from you! Please submit a report in Bugzilla: http://bugzilla.redhat.com/ against the product JBoss Enterprise Application Platform.

When submitting a bug report, be sure to mention the manual's identifier: Getting_Started_Guide

If you have a suggestion for improving the documentation, try to be as specific as possible when describing it. If you have found an error, please include the section number and some of the surrounding text so we can find it easily.

Chapter 1. Introduction

1.1. About Red Hat JBoss Enterprise Application Platform 6

Red Hat JBoss Enterprise Application Platform 6 (JBoss EAP 6) is a middleware platform built on open standards and compliant with the Java Enterprise Edition 6 specification. It integrates JBoss Application Server 7 with high-availability clustering, messaging, distributed caching, and other technologies.

JBoss EAP 6 includes a new, modular structure that allows service enabling only when required, improving start-up speed.

The Management Console and Management Command Line Interface make editing XML configuration files unnecessary and add the ability to script and automate tasks.

In addition, JBoss EAP 6 includes APIs and development frameworks for quickly developing secure and scalable Java EE applications.

Report a bug

1.2. About the Red Hat Customer Portal

The Red Hat Customer Portal is the centralized platform for Red Hat knowledge and subscription resources. Use the Red Hat Customer Portal to:

- Manage and maintain Red Hat entitlements and support contracts;

- Download officially-supported software;

- Access product documentation and the Red Hat Knowledgebase;

- Contact Global Support Services; and

- File bugs against Red Hat products.

The Customer Portal is available here: https://access.redhat.com.

Report a bug

1.3. About the Red Hat JBoss Developer Program

The Red Hat JBoss Developer Program ("the Program") allows you to deploy, free of charge, certain Red Hat Subscriptions for development purposes. The Red Hat Subscriptions offered to you in this Program are unsupported and may not address known security vulnerabilities. They may be used for development purposes only and are not intended for other purposes such as use in production environments or for accessing updates without (an) active Red Hat Subscription(s). For complete details about the Red Hat JBoss Developer Program, see http://www.jboss.org/developer-program/termsandconditions.

Report a bug

1.4. About the Full Red Hat JBoss Commercial Program

The Full Red Hat JBoss Commercial Program allows you to deploy to production environments. It provides additional entitlements to software updates and patches, support services, and access to the Red Hat Knowledgebase. To participate in the program, you must create an account on the Customer Portal at https://access.redhat.com/. To learn more about this program, see Section 1.2, “About the Red Hat Customer Portal”.

Report a bug

1.5. How to Find More Information

The purpose of this guide is to get you up and running with Red Hat JBoss Enterprise Application Platform as quickly as possible. If you want to learn more, the complete documentation suite for JBoss EAP is available on the Customer Portal at https://access.redhat.com/site/documentation/en-US/JBoss_Enterprise_Application_Platform.

Report a bug

Chapter 2. Prerequisites

2.1. JBoss EAP 6 Installation Prerequisites

Summary

JBoss EAP is available under the Red Hat JBoss Developer Program or the Full Red Hat JBoss Commercial Program. For more information about the Red Hat JBoss Developer Program, see Section 1.3, “About the Red Hat JBoss Developer Program”. For more information about the Full Red Hat JBoss Commercial Program, see Section 1.4, “About the Full Red Hat JBoss Commercial Program”. The following steps describe the prerequisites for both programs.

Common Prerequisites

- Review the supported configurations and ensure your system is supported: https://access.redhat.com/site/articles/111663.

- If you set up an account on the Red Hat Customer Portal and are participating in the Full Red Hat JBoss Commercial Program, ensure that your system is up to date with Red Hat issued updates and errata.

ZIP/Installer Prerequisites

- You must grant administration privileges for the installation directory.

- Ensure that the chosen JDK has been extracted (or installed). See the JDK documentation for information on how to do this.

- On Microsoft Windows Server, ensure that the JAVA_HOME and PATH environment variables have been set, otherwise shortcuts will not work.

- On Hewlett-Packard HP-UX, ensure that an unzip utility has been installed.

Report a bug

Chapter 3. Download and Install the Product

3.1. JBoss EAP Installation Overview

This guide provides instructions for the simplest installation process to help you get started using JBoss EAP as quickly as possible. Complete installation procedures can be found in the Installation Guide for JBoss EAP. After you install JBoss EAP, you can configure the server using the Management CLI or the Management Console. For information about how to configure JBoss EAP, see the Administration and Configuration Guide for JBoss EAP. Both guides are located on the Customer Portal at https://access.redhat.com/site/documentation/JBoss_Enterprise_Application_Platform/.

You can install JBoss EAP in either of the following ways.

- You can install JBoss EAP using the graphical installation program.

- You can install JBoss EAP using a ZIP file.

Follow the instructions based on your preferred method of installation.

Report a bug

3.2. Download and Install JBoss EAP Using the Graphical Installation Program

3.2.1. Download the JBoss EAP 6 Installation Program

Summary

JBoss EAP is available under the Red Hat JBoss Developer Program or the Full Red Hat JBoss Commercial Program. Follow the procedure below that matches your program choice.

Procedure 3.1. Download the JBoss EAP Installation Program from the Customer Portal under the Full Red Hat JBoss Commercial Program

Follow this procedure if you are participating in the Full Red Hat JBoss Commercial Program. For more information about this program, see Section 1.4, “About the Full Red Hat JBoss Commercial Program”.

1. Open a browser and log into the Customer Portal at https://access.redhat.com.

2. Click Downloads.

3. Click Red Hat JBoss Enterprise Application Platform in the Product Downloads list.

4. Select the correct JBoss EAP version from the Version drop-down menu.

5. Find Red Hat JBoss Enterprise Application Platform 6.x.x Installer in the list and click the Download option.

6. You are prompted to save the JAR file to a directory of your choice. Choose a directory and save the file.

Result

The JBoss EAP 6 installation program JAR file has been downloaded successfully to the target machine.

Report a bug

3.2.2. Run the JBoss EAP Installation Program

The JBoss EAP installation program can be run in either graphical or text mode. This topic covers the command to run the installation program in graphical mode.

If you are unsure about an option, simply take the default. You can easily configure the server at a later time. For more information about how configure the JBoss EAP server, see the Administration and Configuration Guide for Red Hat JBoss Enterprise Application Platform 6 located on the Customer Portal at https://access.redhat.com/site/documentation/JBoss_Enterprise_Application_Platform/.

Procedure 3.2. Run the JBoss EAP Installation Program

1. Open a terminal and navigate to the directory containing the downloaded installation program JAR.

2. Type the following command:

java -jar jboss-eap-6.3.0-installer.jar

3. Follow the instructions in the table below.

Table 3.1. JBoss EAP Installation Program Screens

Screen name

When it Appears

Description

Section A.1, “Language Selection”

Always

Choose the desired language for the installation program and click OK.

Section A.2, “End User License Agreement”

Always

The EULA for RED HAT JBOSS MIDDLEWARE.

Select "I accept the terms of this license agreement", and click Next.

Section A.3, “Installation Path”

Always

Select the installation path for JBoss EAP and click Next. You are prompted to create the new directory, or, if it exists, to replace the named directory.

Section A.4, “Select the Packs to Install”

Always

Select the packs to install. Required packs are disabled for deselection.

Section A.5, “Administrative User Creation”

Always

Create an administrative user and assign a password. Then click Next.

Section A.6, “Quickstart Installation”

Always

Install the quickstart examples. Choose Yes and select the installation path. Then click Next.

Section A.7, “Maven Repository Setup”

If you choose to install the quickstart examples

Keep the default selections to automatically configure the default Maven settings and use the publicly hosted Maven repository. Then click Next.

Section A.8, “Socket Binding Setup”

Always

Keep the default port bindings, then click Next.

Section A.9, “Server Launch”

Always

Select the startup option required on completion of the installation process. Then click Next.

Section A.10, “Configure Logging Levels”

Always

Choose No to skip configuration of logging levels. Then click Next.

Section A.11, “Configure Runtime Environment”

Always

Choose Perform default configuration and click Next to continue.

Section A.12, “Review Installation Components”

Always

Review your selections and click Next.

Section A.13, “Installation Progress”

Always

When installation progress completes, click Next.

Section A.14, “Installation Processing Finished”

Always

When processing finishes, click Next.

Section A.15, “Create Shortcuts”

Always

Accept the default and click Next.

Section A.16, “Generate Install Script”

Always

Click Done.

Installation is now complete.

Result

The installation is complete and JBoss EAP 6 is installed on your target machine.

Report a bug

3.3. Download and Install JBoss EAP Using the ZIP

3.3.1. Download JBoss EAP 6 (ZIP Installation)

Summary

JBoss EAP is available under the Red Hat JBoss Developer Program or the Full Red Hat JBoss Commercial Program. Follow the procedure below that matches your program choice.

Procedure 3.3. Download the ZIP file from the Customer Portal under the Full Red Hat JBoss Commercial Program

Follow this procedure if you are participating in the Full Red Hat JBoss Commercial Program. For more information about this program, see Section 1.4, “About the Full Red Hat JBoss Commercial Program”.

1. Open a browser and log into the Red Hat Customer Portal at https://access.redhat.com.

2. Click Downloads.

3. Click Red Hat JBoss Enterprise Application Platform in the Product Downloads list.

4. Select the correct JBoss EAP version from the Version drop-down menu.

5. Find Red Hat JBoss Enterprise Application Platform 6.x.x in the list and click the Download option.

6. You are prompted to save the ZIP file to a directory of your choice. Choose a directory and save the file.

Procedure 3.4. Download the ZIP file from jboss.org under the Red Hat JBoss Developer Program

Follow this procedure if you are participating in the Red Hat JBoss Developer Program. For more information about this program, see Section 1.3, “About the Red Hat JBoss Developer Program”.

1. Open a web browser and access this URL: http://www.jboss.org/products/eap/

2. Click the Download JBoss EAP link on the left side of the page to display product download information.

3. Under Download JBoss EAP 6.3.0, click the ZIP link to download the JBoss EAP archive.

4. You are prompted to save the ZIP file to a directory of your choice. Choose a directory and save the file.

Result

The JBoss EAP 6 ZIP file has been downloaded successfully to the target machine.

Report a bug

3.3.2. Install JBoss EAP 6 (ZIP Installation)

Summary

This topic covers the steps to install JBoss EAP 6 using the downloaded ZIP file.

Procedure 3.5. ZIP File Installation

1. Move the ZIP archive to the desired location.

Move the ZIP file to the server and directory where you plan to install JBoss EAP 6. The user who will start and stop the server must have read and write access to this directory.

2. Use an appropriate application to extract the ZIP archive to the desired location.

In a Red Hat Enterprise Linux environment, use the unzip utility to extract the contents of the ZIP archive.

In a Microsoft Windows environment, right-click the file and select Extract All.

In a Hewlett-Packard HP-UX environment, use the unzip utility to extract the contents of the ZIP archive.

Result

JBoss EAP 6 has been installed successfully. The directory created by extracting the ZIP archive is the top-level directory for the server. This is referred to as EAP_HOME.

Report a bug

3.4. Download the Quickstart Code Examples

3.4.1. Download the Quickstarts

Summary

JBoss EAP 6 comes with a comprehensive set of quickstart code examples designed to help users begin writing applications using the Java EE 6 technologies.

If you chose to install the quickstart examples when you installed JBoss EAP, you can skip this topic. Otherwise, you can download them now under the Red Hat JBoss Developer Program or the Full Red Hat JBoss Commercial Program. Follow the procedure below that matches your program choice.

Procedure 3.6. Download the Quickstarts under the Full Red Hat JBoss Commercial Program

Follow this procedure if you are participating in the Full Red Hat JBoss Commercial Program. For more information about this program, see Section 1.4, “About the Full Red Hat JBoss Commercial Program”.

1. Open a browser and log into the Red Hat Customer Portal at https://access.redhat.com.

2. Click Downloads.

3. Click Red Hat JBoss Enterprise Application Platform in the Product Downloads list.

4. Select the correct JBoss EAP version from the Version drop-down menu.

5. Find Red Hat JBoss Enterprise Application Platform 6.x.x Quickstarts in the list and click the Download option.

6. You are prompted to save the Zip file to a directory of your choice. Choose a directory and save the file.

7. Unzip the archive in a directory of your choosing.

Procedure 3.7. Download the Quickstarts under the Red Hat JBoss Developer Program

Follow this procedure if you are participating in the Red Hat JBoss Developer Program. For more information about this program, see Section 1.3, “About the Red Hat JBoss Developer Program”.

1. Open a web browser and access this URL: http://www.jboss.org/products/eap/

2. Click the Download JBoss EAP link on the left side of the page to display product download information.

3. Under Download JBoss EAP 6.3.0, click the Quickstarts link to download a Zip archive containing the examples.

4. You are prompted to save the ZIP file to a directory of your choice. Choose a directory and save the file.

5. Unzip the archive in a directory of your choosing.

Report a bug

Chapter 4. Post-install Instructions

4.1. Set Up the Development Environment

4.1.1. Red Hat JBoss Developer Studio Installation Overview

This guide provides instructions for the simplest install path for Red Hat JBoss Developer Studio. For complete installation procedures, see the Installation Guide for Red Hat JBoss Developer Studio on https://access.redhat.com/site/documentation/en-US/Red_Hat_JBoss_Developer_Studio/.

Report a bug

4.1.2. Download Red Hat JBoss Developer Studio

1. Go to https://www.jboss.org/products/devstudio.html.

2. Click the Download Developer Studio 7.1.1 button. You are prompted to save the ZIP file to a directory of your choice.

Report a bug

4.1.3. Install Red Hat JBoss Developer Studio

1. Open a terminal and navigate to the directory containing the downloaded .jar file.

2. Run the following command to launch the GUI installation program:

java -jar jbdevstudio-build_version.jar

Note

Alternatively, you may be able to double-click the .jar file to launch the installation program.

3. Click Next to start the installation process.

4. Select I accept the terms of this license agreement and click Next.

5. Adjust the installation path and click Next.

Note

If the installation path folder does not exist, a prompt will appear. Click Ok to create the folder.

6. Choose a JVM, or leave the default JVM selected, and click Next.

7. Red Hat JBoss Developer Studio includes Red Hat JBoss Enterprise Application Platform. If it was previously installed, choose No. Otherwise, choose Yes to install and configure it for use with Red Hat JBoss Developer Studio.

8. Review the installation details, and click Next.

9. Click Next when the installation process is complete.

10. Configure the desktop shortcuts for Red Hat JBoss Developer Studio, and click Next.

11. Click Done.

Report a bug

4.1.4. Start Red Hat JBoss Developer Studio

To start Red Hat JBoss Developer Studio, you can double-click on the desktop shortcut created during the installation, or you can start it in a command line. This topic describes how to start Red Hat JBoss Developer Studio using the command line.

Procedure 4.1. Command to start Red Hat JBoss Developer Studio

1. Open a terminal and navigate to the Red Hat JBoss Developer Studio installation directory.

2. Run the following command to start Red Hat JBoss Developer Studio:

For Linux:

[localhost]$ ./jbdevstudio

For Microsoft Windows:

C:\JDBS_INSTALL_DIRECTORY > jbdevstudio.bat

Report a bug

4.1.5. Add the JBoss EAP Server Using Define New Server

These instructions assume this is your first introduction to Red Hat JBoss Developer Studio 7.x and you have not yet added any JBoss EAP servers. The procedure below adds the JBoss server using the Define New Server wizard.

Procedure 4.2. Add the server

1. Open the Servers tab. If there is no Servers tab, add it to the panel as follows:

1. Click Window → Show View → Other....

2. Select Servers from the Server folder and click OK.

2. Click on the link to create a new server or right-click within the blank Server panel and select New → Server.

Figure 4.1. Add a new server - No servers available

3. Expand JBoss Enterprise Middleware and choose JBoss Enterprise Application Platform 6.1+. Click Next to create the JBoss runtime and define the server. The next time you define a new server, this dialog displays a Server runtime environment dropdown selection with the new runtime definition.

Figure 4.2. Define a New Server

4. Enter a name, for example "JBoss EAP 6.3 Runtime". Under Home Directory, click Browse and navigate to your JBoss EAP install location. Then click Next.

Figure 4.3. Add New Server Runtime Environment

5. On this screen you define the server behavior. You can start the server manually or let Red Hat JBoss Developer Studio manage it for you. You can also define a remote server for deployment and determine if you want to expose the management port for that server, for example, if you need connect to it using JMX. In this example, we assume the server is local and you want Red Hat JBoss Developer Studio to manage your server so you do not need to check anything. Click Next.

Figure 4.4. Define the New JBoss Server Behavior

6. This screen allows you to configure existing projects for the new server. Because you do not have any projects at this point, click Finish.

Figure 4.5. Modify resources for the new JBoss server

Result

The JBoss EAP Runtime Server is listed in the Servers tab.

Figure 4.6. Server appears in the server list

Report a bug

4.2. Configure Maven

4.2.1. About Maven

Apache Maven is a distributed build automation tool used in Java application development to create, manage, and build software projects. Maven uses standard configuration files called Project Object Model, or POM, files to define projects and manage the build process. POMs describe the module and component dependencies, build order, and targets for the resulting project packaging and output using an XML file. This ensures that the project is built in a correct and uniform manner.

Maven achieves this by using a repository. A Maven repository stores Java libraries, plug-ins, and other build artifacts. The default public repository is the Maven 2 Central Repository, but repositories can be private and internal within a company with a goal to share common artifacts among development teams. Repositories are also available from third-parties. JBoss EAP includes a Maven repository that contains many of the requirements that Java EE developers typically use to build applications on JBoss EAP.

For more information about Maven, see Welcome to Apache Maven.

For more information about Maven repositories, see Apache Maven Project - Introduction to Repositories.

For more information about how to use Maven in JBoss EAP, see the chapter entitled Maven Guide in the Development Guide for Red Hat JBoss Enterprise Application Platform located on the Customer Portal at https://access.redhat.com/site/documentation/JBoss_Enterprise_Application_Platform/.

Report a bug

4.2.2. Configure the Maven Settings

The artifacts and dependencies needed to build and deploy applications to JBoss EAP 6 are hosted on a public repository. You must direct Maven to use this repository when you build your applications. How you do this depends on whether you plan to use Red Hat JBoss Developer Studio or Maven command line to build and deploy your applications.

Red Hat JBoss Developer Studio includes Maven, so there is no need to download and install it separately. If you plan to use Red Hat JBoss Developer Studio to build and deploy your applications, use the following instructions to configure the Maven settings: Section 4.2.3.1, “Configure Maven for Use with Red Hat JBoss Developer Studio”

If you plan to use the Maven command line to build and deploy your applications, you must first download and install Maven using the instructions here: Section 4.2.4.1, “Download and Install Maven”. Then follow these instructions to configure the Maven settings: Section 4.2.4.2, “Configure the Maven Settings for Use with Command Line”

Report a bug

4.2.3. Configure Maven for Red Hat JBoss Developer Studio

4.2.3.1. Configure Maven for Use with Red Hat JBoss Developer Studio

The artifacts and dependencies needed to build and deploy applications to Red Hat JBoss Enterprise Application Platform are hosted on a public repository. You must direct Maven to use this repository when you build your applications. This topic covers the steps to configure Maven if you plan to build and deploy application using Red Hat JBoss Developer Studio.

If you plan to use Maven command line to build and deploy applications, you can skip this topic. Instead, follow the instructions here: Section 4.2.4.2, “Configure the Maven Settings for Use with Command Line”.

Maven is distributed with Red Hat JBoss Developer Studio, so it is not necessary to install it separately. However, you must configure Maven for use by the Java EE Web Project wizard for deployments to JBoss EAP. The procedure below demonstrates how to configure Maven for use with JBoss EAP by editing the Maven configuration file from within Red Hat JBoss Developer Studio.

Procedure 4.3. Configure Maven in Red Hat JBoss Developer Studio

1. Click Window→Preferences, expand JBoss Tools and select JBoss Maven Integration.

Figure 4.7. JBoss Maven Integration Pane in the Preferences Window

2. Click Configure Maven Repositories.

3. Click Add Repository to configure the JBoss GA Tech Preview Maven repository. Complete the Add Maven Repository dialog as follows:

1. Set the Profile ID, Repository ID, and Repository Name values to jboss-ga-repository.

2. Set the Repository URL value to http://maven.repository.redhat.com/techpreview/all.

3. Click the Active by default checkbox to enable the Maven repository.

4. Click OK

Figure 4.8. Add Maven Repository - JBoss Tech Preview

4. Click Add Repository to configure the JBoss Early Access Maven repository. Complete the Add Maven Repository dialog as follows:

1. Set the Profile ID, Repository ID, and Repository Name values to jboss-earlyaccess-repository.

2. Set the Repository URL value to http://maven.repository.redhat.com/earlyaccess/all/.

3. Click the Active by default checkbox to enable the Maven repository.

4. Click OK

Figure 4.9. Add Maven Repository - JBoss Early Access

5. Review the repositories and click Finish.

Figure 4.10. Review Maven Repositories

6. You are prompted with the message "Are you sure you want to update the file 'MAVEN_HOME/settings.xml'?". Click Yes to update the settings. Click OK to close the dialog.

The JBoss EAP Maven repository is now configured for use with Red Hat JBoss Developer Studio.

Report a bug

4.2.4. Configure Maven for Command Line

4.2.4.1. Download and Install Maven

If you plan to use Maven command line to build and deploy your applications to JBoss EAP, you must download and install Maven. If you plan to use Red Hat JBoss Developer Studio to build and deploy your applications, you can skip this procedure as Maven is distributed with Red Hat JBoss Developer Studio.

1. Go to Apache Maven Project - Download Maven and download the latest distribution for your operating system.

2. See the Maven documentation for information on how to download and install Apache Maven for your operating system.

Report a bug

4.2.4.2. Configure the Maven Settings for Use with Command Line

The artifacts and dependencies needed to build and deploy applications to JBoss EAP 6 are hosted on a public repository. If you plan to use Red Hat JBoss Developer Studio to build and deploy applications, you can skip this topic. Instead, follow the instructions here: Section 4.2.3.1, “Configure Maven for Use with Red Hat JBoss Developer Studio”. However, if you plan to use Maven command line, you must direct Maven to use the JBoss EAP 6 Maven Repository across your projects using the Maven settings.

There are 2 ways to configure the settings for use with Maven command line.

- You can copy the preconfigured settings.xml file that ships with the quickstarts.

- You can manually edit the Maven settings.xml file.

This topic describes both methods. If you have downloaded the quickstarts, the first procedure is the simplest way to configure the settings.

Prerequisites

You must install Maven before you configure the settings. For more information, see: Section 4.2.4.1, “Download and Install Maven”

Procedure 4.4. Configure Maven Using the Settings Shipped with the Quickstart Examples

The Red Hat JBoss Enterprise Application Platform Quickstarts ship with a settings.xml file that is configured to use the online JBoss EAP Maven repository. If you have downloaded the quickstarts, this is the easiest way to configure the settings.

1. This procedure overwrites the existing Maven settings file, so you must back up the existing Maven settings.xml file.

1. Locate the Maven install directory for your operating system. It is usually installed in USER_HOME/.m2/ directory.

- For Linux or Mac, this is: ~/.m2/

- For Windows, this is: \Documents and Settings\USER_NAME\.m2\ or \Users\USER_NAME\.m2\

2. If you have an existing USER_HOME/.m2/settings.xml file, rename it or make a backup copy so you can restore it later.

2. If have not yet downloaded the quickstarts, follow the instructions here: Section 3.4.1, “Download the Quickstarts”.

3. Copy the QUICKSTART_HOME/settings.xml file to the USER_HOME/.m2/ directory.

4. If you modify the settings.xml file while Red Hat JBoss Developer Studio is running, follow the procedure at the end of this topic entitled Refresh the Red Hat JBoss Developer Studio User Settings.

Procedure 4.5. Manually Edit and Configure the Maven Settings To Use the Online JBoss EAP Maven Repository

You can manually add the JBoss EAP profiles to an existing Maven settings file.

1. Locate the Maven install directory for your operating system. It is usually installed in USER_HOME/.m2/ directory.

- For Linux or Mac, this is ~/.m2/

- For Windows, this is \Documents and Settings\USER_NAME\.m2\ or \Users\USER_NAME\.m2\

2. If you do not find a settings.xml file, copy the settings.xml file from the USER_HOME/.m2/conf/ directory into the USER_HOME/.m2/ directory.

3. Copy the following XML into the <profiles> element of the file.

<!-- Configure the JBoss GA Maven repository -->

<profile>

<id>jboss-ga-repository</id>

<repositories>

<repository>

<id>jboss-ga-repository</id>

<url>http://maven.repository.redhat.com/techpreview/all</url>

<releases>

<enabled>true</enabled>

</releases>

<snapshots>

<enabled>false</enabled>

</snapshots>

</repository>

</repositories>

<pluginRepositories>

<pluginRepository>

<id>jboss-ga-plugin-repository</id>

<url>http://maven.repository.redhat.com/techpreview/all</url>

<releases>

<enabled>true</enabled>

</releases>

<snapshots>

<enabled>false</enabled>

</snapshots>

</pluginRepository>

</pluginRepositories>

</profile>

<!-- Configure the JBoss Early Access Maven repository -->

<profile>

<id>jboss-earlyaccess-repository</id>

<repositories>

<repository>

<id>jboss-earlyaccess-repository</id>

<url>http://maven.repository.redhat.com/earlyaccess/all/</url>

<releases>

<enabled>true</enabled>

</releases>

<snapshots>

<enabled>false</enabled>

</snapshots>

</repository>

</repositories>

<pluginRepositories>

<pluginRepository>

<id>jboss-earlyaccess-plugin-repository</id>

<url>http://maven.repository.redhat.com/earlyaccess/all/</url>

<releases>

<enabled>true</enabled>

</releases>

<snapshots>

<enabled>false</enabled>

</snapshots>

</pluginRepository>

</pluginRepositories>

</profile>

Copy the following XML into the <activeProfiles> element of the settings.xml file.

<activeProfile>jboss-ga-repository</activeProfile>

<activeProfile>jboss-earlyaccess-repository</activeProfile>

4. If you modify the settings.xml file while Red Hat JBoss Developer Studio is running, follow the procedure at the end of this topic entitled Refresh the Red Hat JBoss Developer Studio User Settings.

Procedure 4.6. Refresh the Red Hat JBoss Developer Studio User Settings

If you modify the settings.xml file while Red Hat JBoss Developer Studio is running, you must refresh the user settings.

1. From the menu, choose Window → Preferences.

2. In the Preferences Window, expand Maven and choose User Settings.

3. Click the Update Settings button to refresh the Maven user settings in Red Hat JBoss Developer Studio.

Figure 4.11. Update Maven User Settings

Important

If your Maven repository contains outdated artifacts, you may encounter one of the following Maven error messages when you build or deploy your project:

- Missing artifact ARTIFACT_NAME

- [ERROR] Failed to execute goal on project PROJECT_NAME; Could not resolve dependencies for PROJECT_NAME

To resolve the issue, delete the cached version of your local repository to force a download of the latest Maven artifacts. The cached repository is located in your ~/.m2/repository/ subdirectory on Linux, or the %SystemDrive%\Users\USERNAME\.m2\repository\ subdirectory on Windows.

Report a bug

Chapter 5. Try It Out

5.1. Run the Quickstarts

5.1.1. Run the Quickstarts in Red Hat JBoss Developer Studio

Procedure 5.1. Import the quickstarts into Red Hat JBoss Developer Studio

Each quickstart ships with a POM (Project Object Model) file that contains project and configuration information for the quickstart. Using this POM file, you can easily import the quickstart into Red Hat JBoss Developer Studio.

Important

If your quickstart project folder is located within the IDE workspace when you import it into Red Hat JBoss Developer Studio, the IDE generates an invalid project name and WAR archive name. Be sure your quickstart project folder is located outside the IDE workspace before you begin!

1. If you have not yet done so, Section 4.2.4.2, “Configure the Maven Settings for Use with Command Line”.

2. Start Red Hat JBoss Developer Studio.

3. From the menu, select File → Import.

4. In the selection list, choose Maven → Existing Maven Projects, then click Next.

Figure 5.1. Import Existing Maven Projects

5. Browse to the directory of the quickstart you plan to test, for example the helloworld quickstart, and click OK. The Projects list box is populated with the pom.xml file of the selected quickstart project.

Figure 5.2. Select Maven Projects

6. Click Finish.

Procedure 5.2. Build and Deploy the helloworld quickstart

The helloworld quickstart is one of the simplest quickstarts and is a good way to verify that the JBoss server is configured and running correctly.

1. If you do not see a Servers tab, add it to the panel as follows:

1. Click Window → Show View → Other....

2. Select Servers from the Server folder and click OK.

2. Right-click on the jboss-helloworld project in the Project Explorer tab and select Run As. You are provided with a list of choices. Select Run on Server.

Figure 5.3. Run As - Run on Server

3. Select jboss-eap-6.3 from the server list and click Next.

Figure 5.4. Run on Server

4. The next screen displays the resources that are configured on the server. The jboss-helloworld quickstart is configured for you. Click Finish to deploy the quickstart.

Figure 5.5. Modify Resources Configured on the Server

5. Review the results.

- In the Server tab, the JBoss EAP 6.3 Runtime Server status changes to [Started, Republish] .

- The server Console tab shows messages detailing the JBoss EAP 6.3 server start and the helloworld quickstart deployment.

- A helloworld tab appears displaying the URL http://localhost:8080/jboss-helloworld/HelloWorld and the text "Hello World!".

- The following messages in the Console confirm deployment of the jboss-helloworld.war file:

JBAS018210: Register web context: /jboss-helloworld

JBAS018559: Deployed "jboss-helloworld.war" (runtime-name : "jboss-helloworld.war")

The registered web context is appended to http://localhost:8080 to provide the URL used to access the deployed application.

6. To verify the helloworld quickstart deployed successfully to the JBoss server, open a web browser and access the application at this URL: http://localhost:8080/jboss-helloworld

Report a bug

5.1.2. Run the Quickstarts Using a Command Line

Procedure 5.3. Build and Deploy the Quickstarts Using a Command Line

You can easily build and deploy the quickstarts using a command line. Be aware that, when using a command line, you are responsible for starting the JBoss server if it is required.

1. If you have not yet done so, Section 4.2.4.2, “Configure the Maven Settings for Use with Command Line”.

2. Review the README.html file in the root directory of the quickstarts.

This file contains general information about system requirements, how to configure Maven, how to add users, and how to run the Quickstarts. Be sure to read through it before you get started.

It also contains a table listing the available quickstarts. The table lists each quickstart name and the technologies it demonstrates. It gives a brief description of each quickstart and the level of experience required to set it up. For more detailed information about a quickstart, click on the quickstart name.

Some quickstarts are designed to enhance or extend other quickstarts. These are noted in the Prerequisites column. If a quickstart lists prerequisites, you must install them first before working with the quickstart.

Some quickstarts require the installation and configuration of optional components. Do not install these components unless the quickstart requires them.

3. Run the helloworld quickstart.

The helloworld quickstart is one of the simplest quickstarts and is a good way to verify that the JBoss server is configured and running correctly. Open the README.html file in the root of the helloworld quickstart. It contains detailed instructions on how to build and deploy the quickstart and access the running application

4. Run the other quickstarts.

Follow the instructions in the README.html file located in the root folder of each quickstart to run the example.

Report a bug

Appendix A. Installation Program Screen Shots

A.1. Language Selection

Figure A.1. JBoss EAP Installation Program Language Selection

Report a bug

A.2. End User License Agreement

Figure A.2. JBoss EAP Installation Program End User License Agreement

Report a bug

A.3. Installation Path

Figure A.3. JBoss EAP Installion Program Installation Path

Report a bug

A.4. Select the Packs to Install

Select or deselect the packs to install. Required packs are disabled for deselection.

Figure A.4. JBoss EAP Installation Program Select Packs to Install

Report a bug

A.5. Administrative User Creation

Figure A.5. JBoss EAP Installation Program Administrative User Creation

Report a bug

A.6. Quickstart Installation

Figure A.6. JBoss EAP Installation Program Quickstart Setup

Report a bug

A.7. Maven Repository Setup

Figure A.7. JBoss EAP Installation Program Maven Repository Setup

Report a bug

A.8. Socket Binding Setup

Determine whether to use the default bindings, or configure custom bindings.

Figure A.8. JBoss EAP Installation Program Default Socket Bindings

Report a bug

A.9. Server Launch

Figure A.9. JBoss EAP Installation Program Server Launch

Report a bug

A.10. Configure Logging Levels

Figure A.10. JBoss EAP Installation Program Configure Logging Levels

Report a bug

A.11. Configure Runtime Environment

Choose Perform advanced configuration to customize installation and configuration of security, caching, LDAP, and datasource options.

Figure A.11. JBoss EAP Installation Program Configure Runtime Environment - Default

Figure A.12. JBoss EAP Installation Program Configure Runtime Environment - Advanced

Report a bug

A.12. Review Installation Components

Figure A.13. JBoss EAP Installation Program Review Selected Components

Report a bug

A.13. Installation Progress

Figure A.14. JBoss EAP Installation Program Component Installation Progress

Report a bug

A.14. Installation Processing Finished

Figure A.15. JBoss EAP Installation Program Processing Finished

Report a bug

A.15. Create Shortcuts

Figure A.16. JBoss EAP Installer Create Shortcuts

Report a bug

A.16. Generate Install Script

Figure A.17. JBoss EAP Installation Program Generate Install Script

Report a bug

Appendix B. Revision History

Revision History

Revision 6.3.0-21

Friday July 25 2014

Lucas Costi

Red Hat JBoss Enterprise Application Platform 6.3.0.GA

Table of Contents

Getting Started Guide

Preface

1. Document Conventions

1.1. Typographic Conventions

1.2. Pull-quote Conventions

1.3. Notes and Warnings

2. Getting Help and Giving Feedback

2.1. Do You Need Help?

2.2. We Need Feedback!

1. Introduction

1.1. About Red Hat JBoss Enterprise Application Platform 6

1.2. About the Red Hat Customer Portal

1.3. About the Red Hat JBoss Developer Program

1.4. About the Full Red Hat JBoss Commercial Program

1.5. How to Find More Information

2. Prerequisites

2.1. JBoss EAP 6 Installation Prerequisites

3. Download and Install the Product

3.1. JBoss EAP Installation Overview

3.2. Download and Install JBoss EAP Using the Graphical Installation Program

3.2.1. Download the JBoss EAP 6 Installation Program

3.2.2. Run the JBoss EAP Installation Program

3.3. Download and Install JBoss EAP Using the ZIP

3.3.1. Download JBoss EAP 6 (ZIP Installation)

3.3.2. Install JBoss EAP 6 (ZIP Installation)

3.4. Download the Quickstart Code Examples

3.4.1. Download the Quickstarts

4. Post-install Instructions

4.1. Set Up the Development Environment

4.1.1. Red Hat JBoss Developer Studio Installation Overview

4.1.2. Download Red Hat JBoss Developer Studio

4.1.3. Install Red Hat JBoss Developer Studio

4.1.4. Start Red Hat JBoss Developer Studio

4.1.5. Add the JBoss EAP Server Using Define New Server

4.2. Configure Maven

4.2.1. About Maven

4.2.2. Configure the Maven Settings

4.2.3. Configure Maven for Red Hat JBoss Developer Studio

4.2.3.1. Configure Maven for Use with Red Hat JBoss Developer Studio

4.2.4. Configure Maven for Command Line

4.2.4.1. Download and Install Maven

4.2.4.2. Configure the Maven Settings for Use with Command Line

5. Try It Out

5.1. Run the Quickstarts

5.1.1. Run the Quickstarts in Red Hat JBoss Developer Studio

5.1.2. Run the Quickstarts Using a Command Line

A. Installation Program Screen Shots

A.1. Language Selection

A.2. End User License Agreement

A.3. Installation Path

A.4. Select the Packs to Install

A.5. Administrative User Creation

A.6. Quickstart Installation

A.7. Maven Repository Setup

A.8. Socket Binding Setup

A.9. Server Launch

A.10. Configure Logging Levels

A.11. Configure Runtime Environment

A.12. Review Installation Components

A.13. Installation Progress

A.14. Installation Processing Finished

A.15. Create Shortcuts

A.16. Generate Install Script

B. Revision History