JBoss Enterprise Application Platform 6.4 Getting Started Guide

JBoss Enterprise Application Platform 6.4 Getting Started Guide
JBoss Enterprise Application
Platform 6.4
Getting Started Guide
For Use with Red Hat JBoss Enterprise Application Platform 6
Nidhi Chaudhary
Sande Gilda
Darrin Mison
Misty Stanley-Jones
Lucas Costi
Vikram Goyal
Scott Mumford
Keerat Verma
Russell Dickenson
Eamon Logue
David Ryan
Tom Wells
JBoss Enterprise Application Platform 6.4 Getting Started Guide
For Use with Red Hat JBoss Enterprise Application Platform 6
Nidhi Chaudhary
Lucas Co sti
Russell Dickenso n
Sande Gilda
Vikram Go yal
Eamo n Lo gue
Darrin Miso n
Sco tt Mumfo rd
David Ryan
Misty Stanley-Jo nes
Keerat Verma
To m Wells
Legal Notice
Co pyright © 20 15 Red Hat, Inc..
This do cument is licensed by Red Hat under the Creative Co mmo ns Attributio n-ShareAlike 3.0
Unpo rted License. If yo u distribute this do cument, o r a mo dified versio n o f it, yo u must pro vide
attributio n to Red Hat, Inc. and pro vide a link to the o riginal. If the do cument is mo dified, all Red
Hat trademarks must be remo ved.
Red Hat, as the licenso r o f this do cument, waives the right to enfo rce, and agrees no t to assert,
Sectio n 4 d o f CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shado wman lo go , JBo ss, MetaMatrix, Fedo ra, the Infinity
Lo go , and RHCE are trademarks o f Red Hat, Inc., registered in the United States and o ther
co untries.
Linux ® is the registered trademark o f Linus To rvalds in the United States and o ther co untries.
Java ® is a registered trademark o f Oracle and/o r its affiliates.
XFS ® is a trademark o f Silico n Graphics Internatio nal Co rp. o r its subsidiaries in the United
States and/o r o ther co untries.
MySQL ® is a registered trademark o f MySQL AB in the United States, the Euro pean Unio n and
o ther co untries.
No de.js ® is an o fficial trademark o f Jo yent. Red Hat So ftware Co llectio ns is no t fo rmally
related to o r endo rsed by the o fficial Jo yent No de.js o pen so urce o r co mmercial pro ject.
The OpenStack ® Wo rd Mark and OpenStack Lo go are either registered trademarks/service
marks o r trademarks/service marks o f the OpenStack Fo undatio n, in the United States and o ther
co untries and are used with the OpenStack Fo undatio n's permissio n. We are no t affiliated with,
endo rsed o r spo nso red by the OpenStack Fo undatio n, o r the OpenStack co mmunity.
All o ther trademarks are the pro perty o f their respective o wners.
Abstract
This bo o k pro vides the basic steps to get started with JBo ss EAP 6 .
1
G et t ing St art ed G uide
Chapter 1. Introduction
1.1. About Red Hat JBoss Ent erprise Applicat ion Plat form 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 t he Red Hat Cust omer Port al
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.
D ownload 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.
Report a bug
1.3. About t he 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 D eveloper Program, see http://www.jboss.org/developerprogram/termsandconditions.
Report a bug
1.4 . About t he Full Red Hat JBoss Commercial Program
The Full Red Hat JBoss Commercial Program allows you to deploy to production environments. It
2
⁠Chapt er 1 . Int roduct ion
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 t o Find More Informat ion
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/enUS/JBoss_Enterprise_Application_Platform.
Report a bug
3
G et t ing St art ed G uide
Chapter 2. Prerequisites
2.1. JBoss EAP 6 Inst allat ion Prerequisit es
Su mmary
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 D eveloper 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.
C o mmo n Prereq u isit es
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.
Z IP/In st aller Prereq u isit es
You must grant administration privileges for the installation directory.
Ensure that the chosen JD K has been extracted (or installed). See the JD K 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 unzi p utility has been installed.
Report a bug
4
⁠Chapt er 3. Download and Inst all t he Product
Chapter 3. Download and Install the Product
3.1. JBoss EAP Inst allat ion 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 Z IP file.
Follow the instructions based on your preferred method of installation.
Report a bug
3.2. Download and Inst all JBoss EAP Using t he Graphical Inst allat ion
Program
3.2.1. Download t he JBoss EAP 6 Inst allat ion Program
Su mmary
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.
Pro ced u re 3.1. D o wn lo ad t h e JB o ss EAP In st allat io n Pro g ram f ro m t h e C u st o mer Po rt al
u n d er t h e Fu ll R ed H at JB o ss C o mmercial Pro g ram
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 D o wn lo ad s.
3. Click R ed Hat JBo ss Enterpri se Appl i cati o n P l atfo rm in the P ro d uct
D o wnl o ad s list.
4. Select the correct JBoss EAP version from the Versi o n drop-down menu.
5. Find R ed Hat JBo ss Enterpri se Appl i cati o n P l atfo rm 6 . x.x Instal l er in
the list and click the D o wnl o ad option.
6. You are prompted to save the JAR file to a directory of your choice. Choose a directory and
save the file.
Pro ced u re 3.2. D o wn lo ad t h e JB o ss EAP In st allat io n Pro g ram f ro m jb o ss.o rg u n d er t h e
R ed H at JB o ss D evelo p er Pro g ram
5
G et t ing St art ed G uide
Follow this procedure if you are participating in the Red Hat JBoss D eveloper Program. For more
information about this program, see Section 1.3, “ About the Red Hat JBoss D eveloper Program” .
1. Open a browser and access the following URL: http://www.jboss.org/products/eap.
A. To download the installation program for current GA shipping version of the product, click
the D o wnl o ad button on the right side of the page.
B. 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.
a. Click the D o wnl o ad JBo ss EAP link on the left side of the page.
b. Click the Instal l er link under the D o wnl o ad 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.
R esu lt
The JBoss EAP 6 installation program JAR file has been downloaded successfully to the target
machine.
Report a bug
3.2.2. Run t he JBoss EAP Inst allat ion 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/.
Pro ced u re 3.3. R u n t h e JB o ss EAP In st allat io n Pro g ram
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
3. Follow the instructions in the table below.
T ab le 3.1. JB o ss EAP In st allat io n Pro g ram Screen s
Screen n ame
Wh en it Ap p ears
D escrip t io n
Section A.1,
“ Language Selection”
Section A.2, “ End User
License Agreement”
Always
Choose the desired language for the installation
program and click O K.
The EULA for RED HAT JBOSS MID D LEWARE.
6
Always
Select " I accept the terms of this license
agreement" , and click Next.
⁠Chapt er 3. Download and Inst all t he Product
Screen n ame
Wh en it Ap p ears
D escrip t io n
Section A.3,
“ Installation Path”
Always
Section A.4, “ Select the
Packs to Install”
Section A.5,
“ Administrative User
Creation”
Section A.6,
“ Quickstart
Installation”
Section A.7, “ Maven
Repository Setup”
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.
Select the packs to install. Required packs are
disabled for deselection.
Create an administrative user and assign a
password. Then click Next.
Section A.8, “ Socket
Binding Setup”
Section A.9, “ Server
Launch”
Always
Section A.10,
“ Configure Logging
Levels”
Section A.11,
“ Configure Runtime
Environment”
Section A.12, “ Review
Installation
Components”
Section A.13,
“ Installation Progress”
Section A.14,
“ Installation
Processing Finished”
Section A.15, “ Create
Shortcuts”
Section A.16,
“ Generate Install
Script”
Always
Always
Always
Install the quickstart examples. Choose Y es 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.
Keep the default port bindings, then click Next.
Always
Select the preferred startup option on
completion of the installation process. Then
click Next.
Choose No to skip configuration of logging
levels. Then click Next.
Always
Choose P erfo rm d efaul t co nfi g urati o n
and click Next to continue.
Always
Review your selections and click Next.
Always
Always
When installation progress completes, click
Next.
When processing finishes, click Next.
Always
Accept the default and click Next.
Always
Click D o ne.
Installation is now complete.
R esu lt
The installation is complete and JBoss EAP 6 is installed on your target machine.
Report a bug
3.3. Download and Inst all JBoss EAP Using t he ZIP
3.3.1. Download JBoss EAP 6 (ZIP Inst allat ion)
7
G et t ing St art ed G uide
Su mmary
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.
Pro ced u re 3.4 . D o wn lo ad t h e Z IP f ile f ro m t h e C u st o mer Po rt al u n d er t h e Fu ll R ed H at
JB o ss C o mmercial Pro g ram
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 D o wn lo ad s.
3. Click R ed Hat JBo ss Enterpri se Appl i cati o n P l atfo rm in the P ro d uct
D o wnl o ad s list.
4. Select the correct JBoss EAP version from the Versi o n drop-down menu.
5. Find R ed Hat JBo ss Enterpri se Appl i cati o n P l atfo rm 6 . x.x in the list and click
the D o wnl o ad option.
6. You are prompted to save the Z IP file to a directory of your choice. Choose a directory and
save the file.
Pro ced u re 3.5. D o wn lo ad t h e Z IP f ile f ro m jb o ss.o rg u n d er t h e R ed H at JB o ss
D evelo p er Pro g ram
Follow this procedure if you are participating in the Red Hat JBoss D eveloper Program. For more
information about this program, see Section 1.3, “ About the Red Hat JBoss D eveloper Program” .
1. Open a web browser and access this URL: http://www.jboss.org/products/eap/
2. Click the D o wnl o ad JBo ss EAP link on the left side of the page.
3. Click the ZIP
link under the D o wnl o ad column for the correct product version.
4. You are prompted to save the Z IP file to a directory of your choice. Choose a directory and
save the file.
R esu lt
The JBoss EAP 6 Z IP file has been downloaded successfully to the target machine.
Report a bug
3.3.2. Inst all JBoss EAP 6 (ZIP Inst allat ion)
Su mmary
This topic covers the steps to install JBoss EAP 6 using the downloaded Z IP file.
Pro ced u re 3.6 . Z IP File In st allat io n
1. Mo ve t h e Z IP arch ive t o t h e d esired lo cat io n .
Move the Z IP file to the server and directory where you plan to install JBoss EAP 6. The user
8
⁠Chapt er 3. Download and Inst all t he Product
who will start and stop the server must have read and write access to this directory.
2. U se an ap p ro p riat e ap p licat io n t o ext ract t h e Z IP arch ive t o t h e d esired lo cat io n .
In a Red Hat Enterprise Linux environment, use the unzi p utility to extract the contents of the
Z IP archive.
In a Microsoft Windows environment, right-click the file and select Extract Al l .
In a Hewlett-Packard HP-UX environment, use the unzi p utility to extract the contents of the
Z IP archive.
R esu lt
JBoss EAP 6 has been installed successfully. The directory created by extracting the Z IP archive is
the top-level directory for the server. This is referred to as EAP_HOME.
Report a bug
3.4 . Download t he Quickst art Code Examples
3.4 .1. Download t he Quickst art s
Su mmary
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.
Pro ced u re 3.7. D o wn lo ad t h e Q u ickst art s u n d er t h e Fu ll R ed H at JB o ss C o mmercial
Pro g ram
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 D o wn lo ad s.
3. Click R ed Hat JBo ss Enterpri se Appl i cati o n P l atfo rm in the P ro d uct
D o wnl o ad s list.
4. Select the correct JBoss EAP version from the Versi o n drop-down menu.
5. Find R ed Hat JBo ss Enterpri se Appl i cati o n P l atfo rm 6 . x.x Q ui ckstarts in
the list and click the D o wnl o ad option.
6. You are prompted to save the Z ip file to a directory of your choice. Choose a directory and
save the file.
7. Unzip the archive in a directory of your choosing.
Pro ced u re 3.8. D o wn lo ad t h e Q u ickst art s u n d er t h e R ed H at JB o ss D evelo p er Pro g ram
9
G et t ing St art ed G uide
Follow this procedure if you are participating in the Red Hat JBoss D eveloper Program. For more
information about this program, see Section 1.3, “ About the Red Hat JBoss D eveloper Program” .
1. Open a web browser and access this URL: http://www.jboss.org/products/eap/
2. Click the D o wnl o ad JBo ss EAP link on the left side of the page to display product
download information.
3. Under D o wnl o ad JBo ss EAP , click the Q ui ckstarts link to download a Z ip archive
containing the examples.
4. You are prompted to save the Z IP 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
10
⁠Chapt er 4 . Post - inst all Inst ruct ions
Chapter 4. Post-install Instructions
4 .1. Set Up t he Development Environment
4 .1.1. Red Hat JBoss Developer St udio Inst allat ion Overview
This guide provides instructions for the simplest install path for Red Hat JBoss D eveloper Studio. For
complete installation procedures, see the Installation Guide for Red Hat JBoss D eveloper Studio on
https://access.redhat.com/site/documentation/en-US/Red_Hat_JBoss_D eveloper_Studio/.
Report a bug
4 .1.2. Download Red Hat JBoss Developer St udio
1. Go to https://www.jboss.org/products/devstudio.html.
2. Click the D o wnl o ad button. You are prompted to save the Z IP file to a directory of your
choice.
Report a bug
4 .1.3. Inst all Red Hat JBoss Developer St udio
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 o f thi s l i cense ag reement 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 O k to create the
folder.
6. Choose a JVM, or leave the default JVM selected, and click Next.
7. Red Hat JBoss D eveloper Studio includes Red Hat JBoss Enterprise Application Platform. If it
was previously installed, choose No . Otherwise, choose Y es to install and configure it for use
with Red Hat JBoss D eveloper Studio.
11
G et t ing St art ed G uide
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 D eveloper Studio, and click Next.
11. Click D o ne.
Report a bug
4 .1.4 . St art Red Hat JBoss Developer St udio
To start Red Hat JBoss D eveloper 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 D eveloper Studio using the command line.
Pro ced u re 4 .1. C o mman d t o st art R ed H at JB o ss D evelo p er St u d io
1. Open a terminal and navigate to the Red Hat JBoss D eveloper Studio installation directory.
2. Run the following command to start Red Hat JBoss D eveloper Studio:
For Linux:
[localhost]$ ./jbdevstudio
For Microsoft Windows:
C:\JBDS_INSTALL_DIRECTORY > jbdevstudio.bat
Report a bug
4 .1.5. Add t he JBoss EAP Server Using Define New Server
These instructions assume this is your first introduction to Red Hat JBoss D eveloper 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 D efi ne New Server wizard.
Pro ced u re 4 .2. Ad d t h e server
1. Open the Servers tab. If there is no Servers tab, add it to the panel as follows:
a. Click Win d o w → Sh o w View → O t h er....
b. Select Servers from the Server folder and click O K.
2. Click on No servers are avai l abl e. C l i ck thi s l i nk to create a new
server. . . or, if you prefer, right-click within the blank Server panel and select N ew →
Server.
12
⁠Chapt er 4 . Post - inst all Inst ruct ions
Fig u re 4 .1. Ad d a n ew server - N o servers availab le
3. Expand JBo ss Enterpri se Mi d d l eware and choose JB o ss En t erp rise Ap p licat io n
Plat f o rm 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 runti me envi ro nment selection with
the new runtime definition.
13
G et t ing St art ed G uide
Fig u re 4 .2. D ef in e a N ew Server
4. Create a Server Adapter to manage starting and stopping the server. Keep the defaults and
click Next.
14
⁠Chapt er 4 . Post - inst all Inst ruct ions
Fig u re 4 .3. C reat e a N ew Server Ad ap t er
5. Enter a name, for example " JBoss EAP 6.4 Runtime" . Under Ho me D i recto ry, click Bro wse
and navigate to your JBoss EAP install location. Then click Next.
15
G et t ing St art ed G uide
Fig u re 4 .4 . Ad d N ew Server R u n t ime En viro n men t
Note
Some quickstarts require that you run the server with a different profile or additional
arguments. To deploy a quickstart that requires the ful l profile, you must define a
new server and add a Server R unti me Envi ro nment that specifies stand al o neful l . xml for the C o nfi g urati o n fi l e. 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 Fi ni sh.
16
⁠Chapt er 4 . Post - inst all Inst ruct ions
Fig u re 4 .5. Mo d if y reso u rces f o r t h e n ew JB o ss server
R esu lt
The JBoss EAP Runtime Server is listed in the Servers tab.
17
G et t ing St art ed G uide
Fig u re 4 .6 . Server ap p ears in t h e 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 t he Maven Set t ings
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 D eveloper Studio
or Maven command line to build and deploy your applications.
Red Hat JBoss D eveloper Studio includes Maven, so there is no need to download and install it
separately. If you plan to use Red Hat JBoss D eveloper 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 D eveloper Studio”
18
⁠Chapt er 4 . Post - inst all Inst ruct ions
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, “ D ownload 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 St udio
4 .2 .3.1 . Co nfigure Mave n fo r Use wit h Re d Hat JBo ss De ve lo pe r St udio
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 D eveloper 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 D eveloper 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 D eveloper Studio.
Pro ced u re 4 .3. C o n f ig u re Maven in R ed H at JB o ss D evelo p er St u d io
1. Click Win d o w→Pref eren ces, expand JBo ss T o o l s and select JBo ss Maven
Integ rati o n.
Fig u re 4 .7. JB o ss Maven In t eg rat io n Pan e in t h e Pref eren ces Win d o w
2. Click C o nfi g ure Maven R epo si to ri es.
3. Click Ad d R epo si to ry to configure the JBoss GA Tech Preview Maven repository.
Complete the Ad d Maven R epo si to ry dialog as follows:
19
G et t ing St art ed G uide
a. Set the P ro fi l e ID , R epo si to ry ID , and R epo si to ry Name values to jbo ssg a-repo si to ry.
b. Set the R epo si to ry UR L value to
http: //maven. repo si to ry. red hat. co m/techprevi ew/al l .
c. Click the Acti ve by d efaul t checkbox to enable the Maven repository.
d. Click O K
Fig u re 4 .8. Ad d Maven R ep o sit o ry - JB o ss T ech Preview
4. Click Ad d R epo si to ry to configure the JBoss Early Access Maven repository. Complete the
Ad d Maven R epo si to ry dialog as follows:
a. Set the P ro fi l e ID , R epo si to ry ID , and R epo si to ry Name values to jbo ssearl yaccess-repo si to ry.
b. Set the R epo si to ry UR L value to
http: //maven. repo si to ry. red hat. co m/earl yaccess/al l /.
c. Click the Acti ve by d efaul t checkbox to enable the Maven repository.
d. Click O K
20
⁠Chapt er 4 . Post - inst all Inst ruct ions
Fig u re 4 .9 . Ad d Maven R ep o sit o ry - JB o ss Early Access
5. Review the repositories and click Fi ni sh.
21
G et t ing St art ed G uide
Fig u re 4 .10. R eview Maven R ep o sit o ries
6. You are prompted with the message " Are you sure you want to update the file
'MAVEN_HOME/settings.xml'?" . Click Y es to update the settings. Click O K to close the dialog.
The JBoss EAP Maven repository is now configured for use with Red Hat JBoss D eveloper
Studio.
Report a bug
4 .2.4 . Configure Maven for Command Line
4 .2 .4 .1 . Do wnlo ad and Inst all Mave n
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 D eveloper Studio to build and
deploy your applications, you can skip this procedure as Maven is distributed with Red Hat JBoss
D eveloper Studio.
1. Go to Apache Maven Project - D ownload Maven and download the latest distribution for your
operating system.
22
⁠Chapt er 4 . Post - inst all Inst ruct ions
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 . Co nfigure t he Mave n Se t t ings fo r Use wit h Co m m and 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 D eveloper 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 D eveloper 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 setti ng s. xml file that ships with the quickstarts.
You can manually edit the Maven setti ng s. xml file.
This topic describes both methods. If you have downloaded the quickstarts, the first procedure is the
simplest way to configure the settings.
Prereq u isit es
You must install Maven before you configure the settings. For more information, see: Section 4.2.4.1,
“ D ownload and Install Maven”
Pro ced u re 4 .4 . C o n f ig u re Maven U sin g t h e Set t in g s Sh ip p ed wit h t h e Q u ickst art
Examp les
The Red Hat JBoss Enterprise Application Platform Quickstarts ship with a setti ng s. 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 setti ng s. xml file.
a. 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: \D o cuments and Setti ng s\USER_NAME\. m2\ or
\Users\USER_NAME\. m2\
b. If you have an existing USER_HOME/. m2/setti ng s. 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,
“ D ownload the Quickstarts” .
3. Copy the QUICKSTART_HOME/setti ng s. xml file to the USER_HOME/. m2/ directory.
4. If you modify the setti ng s. xml file while Red Hat JBoss D eveloper Studio is running,
follow the procedure at the end of this topic entitled Refresh the Red Hat JBoss Developer Studio
User Settings.
Pro ced u re 4 .5. Man u ally Ed it an d C o n f ig u re t h e Maven Set t in g s T o U se t h e O n lin e
JB o ss EAP Maven R ep o sit o ry
23
G et t ing St art ed G uide
JB o ss EAP Maven R ep o sit o ry
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 \D o cuments and Setti ng s\USER_NAME\. m2\ or
\Users\USER_NAME\. m2\
2. If you do not find a setti ng s. xml file, copy the setti ng s. xml file from the
USER_HOME/. m2/co nf/ directory into the USER_HOME/. m2/ directory.
3. Copy the following XML into the <pro fi l es> 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>
24
⁠Chapt er 4 . Post - inst all Inst ruct ions
<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 <acti veP ro fi l es> element of the setti ng s. xml file.
<activeProfile>jboss-ga-repository</activeProfile>
<activeProfile>jboss-earlyaccess-repository</activeProfile>
4. If you modify the setti ng s. xml file while Red Hat JBoss D eveloper Studio is running,
follow the procedure at the end of this topic entitled Refresh the Red Hat JBoss Developer Studio
User Settings.
Pro ced u re 4 .6 . R ef resh t h e R ed H at JB o ss D evelo p er St u d io U ser Set t in g s
If you modify the setti ng s. xml file while Red Hat JBoss D eveloper Studio is running, you must
refresh the user settings.
1. From the menu, choose Win d o w → Pref eren ces.
2. In the P references Window, expand Maven and choose User Setti ng s.
3. Click the Upd ate Setti ng s button to refresh the Maven user settings in Red Hat JBoss
D eveloper Studio.
25
G et t ing St art ed G uide
Fig u re 4 .11. U p d at e Maven U ser Set t in g s
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/repo si to ry/
subdirectory on Linux, or the %SystemDrive%\Users\USERNAME\. m2\repo si to ry\
subdirectory on Windows.
Report a bug
26
⁠Chapt er 5. T ry It O ut
Chapter 5. Try It Out
5.1. Run t he Quickst art s
5.1.1. Run t he Quickst art s in Red Hat JBoss Developer St udio
This section describes how to use Red Hat JBoss D eveloper Studio to deploy the quickstarts and run
the Arquillian tests.
Pro ced u re 5.1. Imp o rt t h e q u ickst art s in t o R ed H at JB o ss D evelo p er St u d io
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 D eveloper Studio.
Important
If your quickstart project folder is located within the ID E workspace when you import it into Red
Hat JBoss D eveloper Studio, the ID E generates an invalid project name and WAR archive
name. Be sure your quickstart project folder is located outside the ID E 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 D eveloper Studio.
3. From the menu, select File → Imp o rt .
4. In the selection list, choose Maven → Exist in g Maven Pro ject s, then click Next.
27
G et t ing St art ed G uide
Fig u re 5.1. Imp o rt Exist in g Maven Pro ject s
5. Browse to the directory of the quickstart you plan to test, for example the hel l o wo rl d
quickstart, and click O K. The P ro jects list box is populated with the po m. xml file of the
selected quickstart project.
28
⁠Chapt er 5. T ry It O ut
Fig u re 5.2. Select Maven Pro ject s
6. Click Fi ni sh.
Pro ced u re 5.2. B u ild an d D ep lo y t h e hel l o wo rl d q u ickst art
The hel l o wo rl d 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 D efine New Server” . If you plan to deploy a
quickstart that requires the ful l profile or additional startup arguments, be sure to create the
server runtime environment as noted in the quickstart instructions.
2. Right-click on the jbo ss-hel l o wo rl d project in the P ro ject Expl o rer tab and select
R u n As. You are provided with a list of choices. Select R u n o n Server.
Fig u re 5.3. R u n As - R u n o n Server
29
G et t ing St art ed G uide
3. Select JBo ss EAP 6 . 1+ R unti me Server from the server list and click Next.
Fig u re 5.4 . R u n o n Server
4. The next screen displays the resources that are configured on the server. The jbo sshel l o wo rl d quickstart is configured for you. Click Fi ni sh to deploy the quickstart.
30
⁠Chapt er 5. T ry It O ut
Fig u re 5.5. Mo d if y R eso u rces C o n f ig u red o n t h e Server
5. Review the results.
In the Server tab, the JBoss EAP 6.x Runtime Server status changes to [Started ,
R epubl i sh] .
The server C o nso l e tab shows messages detailing the JBoss EAP 6.x server start and
the helloworld quickstart deployment.
A hel l o wo rl d tab appears displaying the URL http://localhost:8080/jbosshelloworld/HelloWorld and the text " Hello World!" .
The following messages in the C o nso l e confirm deployment of the jbo sshel l o wo rl d . war file:
31
G et t ing St art ed G uide
JBAS018210: Register web context: /jboss-helloworld
JBAS018559: Deployed "jboss-helloworld.war" (runtime-name :
"jboss-helloworld.war")
The registered web context is appended to http: //l o cal ho st: 80 80 to provide the
URL used to access the deployed application.
6. To verify the hel l o wo rl d quickstart deployed successfully to the JBoss server, open a web
browser and access the application at this URL: http://localhost:8080/jboss-helloworld
Pro ced u re 5.3. R u n t h e bean-val i d ati o n q u ickst art Arq u illian t est s
Some quickstarts do not provide a user interface layer and instead provide Arquillian tests to
demonstrate the code examples. The bean-val i d ati o n quickstart is an example of a quickstart
that provides Arquillian tests.
1. Follow the procedure above to import the bean-val i d ati o n quickstart into Red Hat JBoss
D eveloper Studio.
2. In the Servers tab, right-click on the server and choose St art 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 D efine New Server” .
3. Right-click on the jbo ss-bean-val i d ati o n project in the P ro ject Expl o rer tab and
select R u n As. You are provided with a list of choices. Select Maven B u ild .
4. In the G o al s input field of the Ed i t C o nfi g urati o n dialog, type: cl ean test -P arq jbo ssas-remo te
Then click R un.
32
⁠Chapt er 5. T ry It O ut
Fig u re 5.6 . Ed it C o n f ig u rat io n
5. Review the results.
The server C o nso l e tab shows messages detailing the JBoss EAP server start and the
output of the bean-val i d ati o n 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
33
G et t ing St art ed G uide
[INFO] ----------------------------------------------------------------------[INFO] BUILD SUCCESS
[INFO] ----------------------------------------------------------------------Report a bug
5.1.2. Run t he Quickst art s Using a Command Line
Pro ced u re 5.4 . B u ild an d D ep lo y t h e Q u ickst art s U sin g a C o mman d Lin e
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 R EAD ME. 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
P rereq ui si tes 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. D o not
install these components unless the quickstart requires them.
3. Run the hel l o wo rl d quickstart.
The hel l o wo rl d 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 R EAD ME. html file in the
root of the hel l o wo rl d 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 R EAD ME. html file located in the root folder of each quickstart
to run the example.
Report a bug
34
⁠Appendix A. Inst allat ion Program Screen Shot s
Appendix A. Installation Program Screen Shots
A.1. Language Select ion
Fig u re A.1. JB o ss EAP In st allat io n Pro g ram Lan g u ag e Select io n
Report a bug
A.2. End User License Agreement
35
G et t ing St art ed G uide
Fig u re A.2. JB o ss EAP In st allat io n Pro g ram En d U ser Licen se Ag reemen t
Report a bug
A.3. Inst allat ion Pat h
36
⁠Appendix A. Inst allat ion Program Screen Shot s
Fig u re A.3. JB o ss EAP In st allat io n Pro g ram In st allat io n Pat h
Report a bug
A.4 . Select t he Packs t o Inst all
Select or deselect the packs to install. Required packs are disabled for deselection.
37
G et t ing St art ed G uide
Fig u re A.4 . JB o ss EAP In st allat io n Pro g ram Select Packs t o In st all
Report a bug
A.5. Administ rat ive User Creat ion
38
⁠Appendix A. Inst allat ion Program Screen Shot s
Fig u re A.5. JB o ss EAP In st allat io n Pro g ram Ad min ist rat ive U ser C reat io n
Report a bug
A.6. Quickst art Inst allat ion
39
G et t ing St art ed G uide
Fig u re A.6 . JB o ss EAP In st allat io n Pro g ram Q u ickst art Set u p
Report a bug
A.7. Maven Reposit ory Set up
40
⁠Appendix A. Inst allat ion Program Screen Shot s
Fig u re A.7. JB o ss EAP In st allat io n Pro g ram Maven R ep o sit o ry Set u p
Report a bug
A.8. Socket Binding Set up
D etermine whether to use the default bindings, or configure custom bindings.
41
G et t ing St art ed G uide
Fig u re A.8. JB o ss EAP In st allat io n Pro g ram D ef au lt So cket B in d in g s
Report a bug
A.9. Server Launch
42
⁠Appendix A. Inst allat ion Program Screen Shot s
Fig u re A.9 . JB o ss EAP In st allat io n Pro g ram Server Lau n ch
Report a bug
A.10. Configure Logging Levels
43
G et t ing St art ed G uide
Fig u re A.10. JB o ss EAP In st allat io n Pro g ram Skip Lo g g in g Level C o n f ig u rat io n
Report a bug
A.11. Configure Runt ime Environment
44
⁠Appendix A. Inst allat ion Program Screen Shot s
Fig u re A.11. JB o ss EAP In st allat io n Pro g ram C o n f ig u re R u n t ime En viro n men t - D ef au lt
Report a bug
A.12. Review Inst allat ion Component s
45
G et t ing St art ed G uide
Fig u re A.12. JB o ss EAP In st allat io n Pro g ram R eview Select ed C o mp o n en t s
Report a bug
A.13. Inst allat ion Progress
46
⁠Appendix A. Inst allat ion Program Screen Shot s
Fig u re A.13. JB o ss EAP In st allat io n Pro g ram C o mp o n en t In st allat io n Pro g ress
Report a bug
A.14 . Inst allat ion Processing Finished
47
G et t ing St art ed G uide
Fig u re A.14 . JB o ss EAP In st allat io n Pro g ram Pro cessin g Fin ish ed
Report a bug
A.15. Creat e Short cut s
48
⁠Appendix A. Inst allat ion Program Screen Shot s
Fig u re A.15. JB o ss EAP In st aller C reat e Sh o rt cu t s
Report a bug
A.16. Generat e Inst all Script
49
G et t ing St art ed G uide
Fig u re A.16 . JB o ss EAP In st allat io n Pro g ram G en erat e In st all Scrip t
Report a bug
50
⁠Appendix B. Revision Hist ory
Appendix B. Revision History
R evisio n 6 .4 .0- 12
T u esd ay Ap ril 14 2015
Red Hat JBoss Enterprise Application Platform 6.4.0.GA
Lu cas C o st i
51
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertisement