JBoss Enterprise Application Platform 6.4

Getting Started Guide

For Use with Red Hat JBoss Enterprise Application Platform 6

Red Hat Customer Content Services

Legal Notice

Copyright © 2016 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, OpenShift, 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.
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.4. Configure Maven for 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

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

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 do the following:
  • 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.
  • File bugs against Red Hat products.
The Customer Portal is available here: https://access.redhat.com.

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.

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

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/documentation/en-US/JBoss_Enterprise_Application_Platform/?version=6.4.

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/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 Java development kit has been extracted (or installed). See the Java development kit 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.

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/documentation/en-US/JBoss_Enterprise_Application_Platform/?version=6.4.
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.

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.

Procedure 3.2. Download the JBoss EAP Installation Program 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 browser and access the following URL: http://www.jboss.org/products/eap.
    • To download the installation program for current GA shipping version of the product, click the Download button on the right side of the page.
    • Follow these steps to choose an alternate version, which may include the latest Alpha or Beta releases, as well as previous versions of the product.
      1. Click the Download JBoss EAP link on the left side of the page.
      2. Click the Installer link under the Download column for the correct product version.
  2. 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.

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/documentation/en-US/JBoss_Enterprise_Application_Platform/?version=6.4.

Procedure 3.3. 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.x.x-installer.jar

    Note

    In the Hewlett-Packard HP-UX or Solaris environment, you can specify the required architecture by using the -d32/-d64 switch. Launch the installer by executing either of these commands:
    java -jar -d64 jboss-eap-6.x.x-installer.jar
    or
    java -jar -d32 jboss-eap-6.x.x-installer.jar
  3. Follow the instructions in the table below.

Table 3.1. JBoss EAP Installation Program Screens

Screen name
When it Appears
Description
Always
Choose the desired language for the installation program and click OK.
Always
The EULA for RED HAT JBOSS MIDDLEWARE.
Select "I accept the terms of this license agreement", and click Next.
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.
Always
Select the packs to install. Required packs are disabled for deselection.
Always
Create an administrative user and assign a password. Then click Next.
Always
Install the quickstart examples. Choose Yes and select the installation path. Then click Next.
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.
Always
Keep the default port bindings, then click Next.
Always
Select the preferred startup option on completion of the installation process. Then click Next.
Always
Choose No to skip configuration of logging levels. Then click Next.
Always
Choose Perform default configuration and click Next to continue.
Always
Review your selections and click Next.
Always
When installation progress completes, click Next.
Always
When processing finishes, click Next.
Always
Accept the default and click Next.
Always
Click Done.
Installation is now complete.

Procedure 3.4. Text-based Install Process

  1. Open a terminal and navigate to the directory containing the downloaded installation program JAR.
  2. Launch the Text-based installer by executing the following command:
    java -jar jboss-eap-6.x.x-installer.jar -console
  3. Follow the steps to install JBoss EAP 6.
Result
The installation is complete and JBoss EAP 6 is installed on your target machine.

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.5. 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.6. 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.
  3. Click the ZIP link under the Download column for the correct product version.
  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.

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

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

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 Install Red Hat JBoss Developer Studio guide at https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Developer_Studio/.

4.1.2. Download Red Hat JBoss Developer Studio

  1. Click the Download button. You are prompted to save the ZIP file to a directory of your choice.

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 jboss-devstudio-build_version-installer-eap.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.

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:\JBDS_INSTALL_DIRECTORY > jbdevstudio.bat

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 and you have not yet added any Red Hat JBoss Enterprise Application Platform servers. The procedure below adds the JBoss EAP 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 WindowShow ViewOther....
    2. Select Servers from the Server folder and click OK.
  2. Click on No servers are available. Click this link to create a new server... or, if you prefer, right-click within the blank Server panel and select NewServer.
    Add a new server - No servers available

    Figure 4.1. Add a new server - No servers available

  3. Expand JBoss Enterprise Middleware and choose JBoss Enterprise Application Platform 6.1+. Enter a server name, for example, "JBoss Enterprise Application Platform 6.4", then 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 selection with the new runtime definition.
    Define a New Server

    Figure 4.2. Define a New Server

  4. Create a Server Adapter to manage starting and stopping the server. Keep the defaults and click Next.
    Create a New Server Adapter

    Figure 4.3. Create a New Server Adapter

  5. Enter a name, for example "JBoss EAP 6.4 Runtime". Under Home Directory, click Browse and navigate to your JBoss EAP install location. Then click Next.
    Add New Server Runtime Environment

    Figure 4.4. Add New Server Runtime Environment

    Note

    Some quickstarts require that you run the server with a different profile or additional arguments. To deploy a quickstart that requires the full profile, you must define a new server and add a Server Runtime Environment that specifies standalone-full.xml for the Configuration file. Be sure to give the new server a descriptive name.
  6. Configure existing projects for the new server. Because you do not have any projects at this point, click Finish.
    Modify resources for the new JBoss server

    Figure 4.5. Modify resources for the new JBoss server

Result
The JBoss EAP Runtime Server is listed in the Servers tab.
Server appears in the server list

Figure 4.6. Server appears in the server list

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/documentation/en-US/JBoss_Enterprise_Application_Platform/?version=6.4.

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”

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 applications 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 WindowPreferences, expand JBoss Tools and select JBoss Maven Integration.
    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
    Enter Maven profile and repository values.

    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
    Enter Maven profile and repository values.

    Figure 4.9. Add Maven Repository - JBoss Early Access

  5. Review the repositories and click Finish.
    Review Maven profile and repository values.

    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.

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.

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 WindowPreferences.
  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.
    Update Maven User Settings

    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.

Chapter 5. Try It Out

5.1. Run the Quickstarts

5.1.1. Run the Quickstarts in Red Hat JBoss Developer Studio

This section describes how to use Red Hat JBoss Developer Studio to deploy the quickstarts and run the Arquillian tests.

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. Start Red Hat JBoss Developer Studio.
  2. From the menu, select FileImport.
  3. In the selection list, choose MavenExisting Maven Projects, then click Next.
    Import Existing Maven Projects

    Figure 5.1. Import Existing Maven Projects

  4. 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.
    Select Maven Projects

    Figure 5.2. Select Maven Projects

  5. 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 or have not yet defined a server, follow the instructions here: Section 4.1.5, “Add the JBoss EAP Server Using Define New Server”. If you plan to deploy a quickstart that requires the full profile or additional startup arguments, be sure to create the server runtime environment as noted in the quickstart instructions.
  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.
    Run As - Run on Server

    Figure 5.3. Run As - Run on Server

  3. Select JBoss EAP 6.1+ Runtime Server from the server list and click Next.
    Run on Server

    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.
    Modify Resources Configured on the Server

    Figure 5.5. Modify Resources Configured on the Server

  5. Review the results.
    • In the Server tab, the JBoss EAP 6.x Runtime Server status changes to [Started, Republish] .
    • The server Console tab shows messages detailing the JBoss EAP 6.x 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

Procedure 5.3. Run the bean-validation quickstart Arquillian tests

Some quickstarts do not provide a user interface layer and instead provide Arquillian tests to demonstrate the code examples. The bean-validation quickstart is an example of a quickstart that provides Arquillian tests.
  1. Follow the procedure above to import the bean-validation quickstart into Red Hat JBoss Developer Studio.
  2. In the Servers tab, right-click on the server and choose Start to start the JBoss EAP server. If you do not see a Servers tab or have not yet defined a server, follow the instructions here: Section 4.1.5, “Add the JBoss EAP Server Using Define New Server”.
  3. Right-click on the jboss-bean-validation project in the Project Explorer tab and select Run As. You are provided with a list of choices. Select Maven Build.
  4. In the Goals input field of the Edit Configuration dialog, type: clean test -Parq-jbossas-remote
    Then click Run.
    Edit Configuration

    Figure 5.6. Edit Configuration

  5. Review the results.
    The server Console tab shows messages detailing the JBoss EAP server start and the output of the bean-validation quickstart Arquillian tests.
    -------------------------------------------------------
     T E S T S
    -------------------------------------------------------
    Running org.jboss.as.quickstarts.bean_validation.test.MemberValidationTest
    Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.189 sec
    
    Results :
    
    Tests run: 5, Failures: 0, Errors: 0, Skipped: 0
    
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    

5.1.2. Run the Quickstarts Using a Command Line

Procedure 5.4. 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. 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.
  2. 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
  3. Run the other quickstarts.
    Follow the instructions in the README.html file located in the root folder of each quickstart to run the example.

Appendix A. Installation Program Screen Shots

A.1. Language Selection

Choose the desired language for the installation program.

Figure A.1. JBoss EAP Installation Program Language Selection

A.2. End User License Agreement

Agree to the End User License Agreement to continue.

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

A.3. Installation Path

Define the installation path for the JBoss EAP instance.

Figure A.3. JBoss EAP Installation Program Installation Path

A.4. Select the Packs to Install

Select or deselect the packs to install. Required packs are disabled for deselection.
JBoss EAP Installation Program Select Packs to Install

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

A.5. Administrative User Creation

Create an administrative user.

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

A.6. Quickstart Installation

Install the JBoss EAP quickstarts.

Figure A.6. JBoss EAP Installation Program Quickstart Setup

A.7. Maven Repository Setup

JBoss EAP Installation Program Maven Repository Setup

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

A.8. Socket Binding Setup

Determine whether to use the default bindings, or configure custom bindings. If the host is configured for IPv6 only, check the Enable pure IPv6 configuration checkbox.
Use the default bindings for standalone and domain mode.

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

A.9. Server Launch

Select the startup option desired on completion of the installation process.

Figure A.9. JBoss EAP Installation Program Server Launch

A.10. Configure Logging Levels

Choose No to skip configuration of logging level.

Figure A.10. JBoss EAP Installation Program Skip Logging Level Configuration

A.11. Configure Runtime Environment

JBoss EAP Installation Program Configure Runtime Environment - Default

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

A.12. Review Installation Components

Review the list of selected components. Click the Next to continue or Previous to go back and make changes.

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

A.13. Installation Progress

When the installation progress completes, click Next.

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

A.14. Installation Processing Finished

JBoss EAP Installation Program Processing Finished

Figure A.14. JBoss EAP Installation Program Processing Finished

A.15. Create Shortcuts

Choose whether to create shortcuts and how to configure them. Then click Next.

Figure A.15. JBoss EAP Installer Create Shortcuts

A.16. Generate Install Script

Choose whether to generate an installation script containing the selected install options. Then click Done to finish.

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

Appendix B. Revision History

Revision History
Revision 6.4.0-37Thursday September 22 2016Red Hat Customer Content Services
Red Hat JBoss Enterprise Application Platform 6.4 Continuous Release