Websphere Application Server Liberty Profile Guide For Developers
Websphere Application Server Liberty Profile Guide For Developers
WebSphere Application
Server Liberty Profile
Guide for Developers
WebSphere Application Server V8.5.5
profile designed for developers
Simplified development
with the Liberty profile
Brent Daniel
Alex Mulholland
Erin Schnabel
Kevin Smith
ibm.com/redbooks
International Technical Support Organization
August 2013
SG24-8076-01
Note: Before using this information and the product it supports, read the information in
“Notices” on page ix.
© Copyright International Business Machines Corporation 2012, 2013. All rights reserved.
Note to U.S. Government Users Restricted Rights -- Use, duplication or disclosure restricted by GSA ADP
Schedule Contract with IBM Corp.
Contents
Notices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
Authors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
Now you can become a published author, too! . . . . . . . . . . . . . . . . . . . . . . . . xiii
Comments welcome. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiv
Stay connected to IBM Redbooks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiv
Chapter 2. Installation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.1 Installing the WebSphere developer tools. . . . . . . . . . . . . . . . . . . . . . . . . 26
2.1.1 Installation from Eclipse Marketplace . . . . . . . . . . . . . . . . . . . . . . . . 26
2.1.2 Installation from the WASdev community site . . . . . . . . . . . . . . . . . . 27
Contents v
6.1.2 Configuration using the command line . . . . . . . . . . . . . . . . . . . . . . 141
6.2 HTTPS redirect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
6.3 Form login . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
6.3.1 Defining the basic user registry . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
6.3.2 Updating an application to support Form Login . . . . . . . . . . . . . . . 149
6.3.3 Defining bindings between the application and the server . . . . . . . 155
6.4 Securing JMS applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
6.4.1 Setting up user authentication. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
6.4.2 Setting up user authorization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
6.5 JAX-WS security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
6.6 Securing MongoDB applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
Contents vii
viii WebSphere Application Server Liberty Profile Guide for Developers
Notices
This information was developed for products and services offered in the U.S.A.
IBM may not offer the products, services, or features discussed in this document in other countries. Consult your
local IBM representative for information on the products and services currently available in your area. Any
reference to an IBM product, program, or service is not intended to state or imply that only that IBM product,
program, or service may be used. Any functionally equivalent product, program, or service that does not infringe
any IBM intellectual property right may be used instead. However, it is the user's responsibility to evaluate and
verify the operation of any non-IBM product, program, or service.
IBM may have patents or pending patent applications covering subject matter described in this document. The
furnishing of this document does not grant you any license to these patents. You can send license inquiries, in
writing, to:
IBM Director of Licensing, IBM Corporation, North Castle Drive, Armonk, NY 10504-1785 U.S.A.
The following paragraph does not apply to the United Kingdom or any other country where such
provisions are inconsistent with local law: INTERNATIONAL BUSINESS MACHINES CORPORATION
PROVIDES THIS PUBLICATION "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR
IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF NON-INFRINGEMENT,
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of
express or implied warranties in certain transactions, therefore, this statement may not apply to you.
This information could include technical inaccuracies or typographical errors. Changes are periodically made to the
information herein; these changes will be incorporated in new editions of the publication. IBM may make
improvements and/or changes in the product(s) and/or the program(s) described in this publication at any time
without notice.
Any references in this information to non-IBM websites are provided for convenience only and do not in any
manner serve as an endorsement of those websites. The materials at those websites are not part of the materials
for this IBM product and use of those websites is at your own risk.
IBM may use or distribute any of the information you supply in any way it believes appropriate without incurring any
obligation to you.
Any performance data contained herein was determined in a controlled environment. Therefore, the results
obtained in other operating environments may vary significantly. Some measurements may have been made on
development-level systems and there is no guarantee that these measurements will be the same on generally
available systems. Furthermore, some measurements may have been estimated through extrapolation. Actual
results may vary. Users of this document should verify the applicable data for their specific environment.
Information concerning non-IBM products was obtained from the suppliers of those products, their published
announcements or other publicly available sources. IBM has not tested those products and cannot confirm the
accuracy of performance, compatibility or any other claims related to non-IBM products. Questions on the
capabilities of non-IBM products should be addressed to the suppliers of those products.
This information contains examples of data and reports used in daily business operations. To illustrate them as
completely as possible, the examples include the names of individuals, companies, brands, and products. All of
these names are fictitious and any similarity to the names and addresses used by an actual business enterprise is
entirely coincidental.
COPYRIGHT LICENSE:
This information contains sample application programs in source language, which illustrate programming
techniques on various operating platforms. You may copy, modify, and distribute these sample programs in any
form without payment to IBM, for the purposes of developing, using, marketing or distributing application programs
conforming to the application programming interface for the operating platform for which the sample programs are
written. These examples have not been thoroughly tested under all conditions. IBM, therefore, cannot guarantee or
imply reliability, serviceability, or function of these programs. You may copy, modify, and distribute these sample
programs in any form without payment to IBM for the purposes of developing, using, marketing, or distributing
application programs conforming to IBM's application programming interfaces.
The intended audience for this book is developers of web and OSGi applications
who are familiar with web and OSGi application concepts.
This book has been updated to reflect the new features in WebSphere
Application Server V8.5.5.
Authors
This book was produced by a team of specialists from around the world working
at the International Technical Support Organization, Raleigh Center.
Margaret Ticknor, Deana Coble, Shari Deiana, Tamikia Lee, Linda Robinson
International Technical Support Organization, Raleigh Center
Carla Sadtler
International Technical Support Organization, Poughkeepsie Center
Ian Robinson
IBM UK
Jacek Laskowski
IBM Poland
Find out more about the residency program, browse the residency index, and
apply online at:
ibm.com/redbooks/residencies.html
Preface xiii
Comments welcome
Your comments are important to us!
This guide is for developers of web and OSGi applications. It assumes familiarity
with web and OSGi application concepts, but does not assume familiarity with
WebSphere Application Server resources or products. This guide refers to other
IBM Redbooks publications and the WebSphere Application Server V8.5
Information Center for additional information.
The Liberty profile is built by using OSGi technology and concepts. The
fit-for-purpose nature of the run time relies on the dynamic behavior inherent in
the OSGi Framework and Service Registry. As bundles are installed to or
uninstalled from the framework, the services each bundle provides are added or
removed from the service registry. The addition and removal of services similarly
cascades to other dependent services. The result is a dynamic, composable run
time that can be provisioned with only what your application requires and
responds dynamically to configuration changes as your application evolves.
The Liberty profile supports OSGi applications in all editions. The following list
shows supported technologies for OSGi applications (with a reference to the
specification where appropriate):
Web Application Bundles (OSGi R4.2 Enterprise, Chapter 128)
Blueprint Container (OSGi R4.2 Enterprise, Chapter 121)
– Blueprint Transactions
– Blueprint Managed JPA
JNDI (OSGi R4.2 Enterprise, Chapter 126)
OSGi application of Java EE technologies that are supported by the profile
A complete list of the technologies that are supported by the Liberty profile can
be found at the following Information Center website:
http://pic.dhe.ibm.com/infocenter/wasinfo/v8r5/topic/com.ibm.websphere.
wlp.nd.doc/ae/rwlp_prog_model_support.html
The Liberty profile server runs on Java Version 6 or later regardless of the
vendor that provides it.
The empty definition in Example 1-1 starts only the core kernel. Additional
function is enabled using features. Features are described in 1.3.1, “Feature
management” on page 15.
Figure 1-1 The source and design tabs show different views of the server’s configuration
The Liberty profile provides several predefined variables to help make server
configurations portable. The following list demonstrates syntax and briefly
summarizes the supported location variables:
wlp.install.dir This is the profile’s installation directory.
wlp.user.dir This directory is the root of the tree containing user
configuration. By default, this directory is a child of the
installation directory, ${wlp.install.dir}/usr. It can be
configured to an alternative location using an environment
variable when the server is started.
server.config.dir The server configuration directory contains the
server.xml file and any other optional configuration files
that are used to customize the server’s environment. The
name of this directory is used as the server’s name. By
default, this directory is a child of the user directory called
${wlp.user.dir}/servers/serverName.
server.output.dir The server output directory contains resources that are
generated by the server, such as logs. The Liberty profile
supports shared configurations, for example, multiple
running server instances sharing the configuration files.
Shared configurations are supported by allowing the
instance-specific output directory to be moved using an
environment variable when the server is started. By
default, the server output directory is the same as the
server’s configuration directory.
shared.app.dir Shared user applications directory,
${wlp.user.dir}/shared/apps.
shared.config.dir Shared user configuration directory,
${wlp.user.dir}/shared/config.
shared.resource.dir Shared user resources directory,
${wlp.user.dir}/shared/resources.
Figure 1-2 provides an example of a server.xml file that references the variables
from the bootstrap.properties file from Example 1-2.
shared.xml
Config defaults
Config metadata
Kernel Bundle
more.xml
extra.xml
read user
<include location="extra.xml"/> configuration Configuration Manager
server.xml (OSGi Configuration Admin)
Through the use of variables and included files, a wide variety of configuration
patterns becomes possible. Configuration can be shared across servers or
persisted in a source control repository at varying levels of granularity. For
example, a configuration that is associated with a data source can be collected
into a single XML file that is reused (as an included resource) across multiple
server configurations. The data source configuration can use variables (for
output directories, host names, ports, and so on) so that it can be applied directly
across multiple servers unchanged.
Because the run time is dynamic, the configuration manager is tolerant when it
processes configuration information from any source (user or system). The
configuration manager will safely ignore configuration elements or attributes for
which it does not have metadata. For unknown attributes, the values are passed
to the associated configurable services along with the rest of its configuration
data. For unknown configuration definitions, the configuration manager parses
configuration information at the time it becomes available and provides it to
associated configurable services.
monitor-1.0 jsf-2.0
jndi-1.0 jsp-2.2
Kernel
JDK 6.0+
Figure 1-5 Features are the units of composition for a Liberty profile server run time
Features can be added or removed from the server configuration while the server
is running without requiring a server restart.
When a feature is enabled, the bundles that are required by that feature are
installed in the OSGi framework. When a bundle is installed and started, in some
cases, services are registered in the Service Registry. For most bundles in the
Liberty profile, service registration and lifecycle are managed using OSGi
Declarative Services (DS) components.
By default, the Liberty profile will monitor deployed applications for changes.
Updates to static files (HTML, CSS, or JavaScript) or JSP files are detected and
served immediately. Changes to servlet classes cause an automatic restart of
the application.
Caution: For large applications, monitoring the file system for changes to an
application can be resource-intensive. Consider extending the monitoring
interval if you see excessive I/O activity while the server is running.
Application update monitoring should be disabled in production environments.
For information, see 8.1.1, “Turning off application monitoring” on page 182.
The location is the only required attribute for a declared application. It specifies
the location of the application resource (archive, extracted directory, or loose
configuration XML file) and can refer to any location in the file system. If the
specified location is a relative path, it is resolved first against
${server.config.dir}/apps and then against ${shared.app.dir}.
Example 1-4 on page 19 shows the terms for defining a web application in the
serverl.xml file.
Example 1-5 Defining a web application in the server.xml file by using the webApplication
element added in Version 8.5.5
<webApplication contextRoot="helloworld" location="helloworld.war" />
Product extensions usually contain features and bundles, but can also contain
other things such as custom server templates or scripts. In general, the structure
of a product extension resembles the structure of a Liberty profile installation, as
shown in Figure 1-7 on page 22, particularly regarding the following items
Bundles (in a lib/ directory),
Features (in a lib/features/ directory),
Server templates (in a templates/servers/ directory)
Default Extension
Product Extension B (extensionB/)
usr/extension/lib/
usr.ext.bundleX-1.0.jar README.TXT
usr/extension/lib/features/ bin
usrExtFeature-1.0.mf lib/
extB.bundle-1.0.jar
lib/features/
blueprintExtension-1.0.mf
templates/servers/extBServer/
server.xml
Figure 1-7 A Liberty profile installation with default and product extension content
Section 9.2, “Defining a custom feature” on page 193 walks through creating and
packaging a custom feature as a subsystem archive (an *.esa file). Both the
featureManager command and the WebSphere developer tools provide
mechanisms for managing the features that are installed into product extensions.
Chapter 2. Installation
There are several ways to install the Liberty profile. In this chapter, we focus on
the installation methods that are most commonly used for setting up a
development environment.
The Liberty profile is designed for easy operation using the provided scripts and
direct editing of the server configuration XML files. The development tools
provide an integrated development environment (IDE) for application
development with plenty of assistance and short-cuts to aid creating, modifying,
and controlling Liberty profile servers. The development tools make development
easier but are not strictly required, and if you prefer, you can just install the
run time.
For additional installation methods, including installation for production, see the
following Information Center website:
http://pic.dhe.ibm.com/infocenter/wasinfo/v8r5/topic/com.ibm.websphere.
wlp.nd.multiplatform.doc/topics/twlp_inst.html
For supported Eclipse versions and additional installation methods, see the
following Information Center website:
http://pic.dhe.ibm.com/infocenter/radhelp/v9/topic/com.ibm.rad.install.
doc/topics/t_install_wdt.html
“Warning: You are installing software that contains unsigned content. The
authenticity or validity of this software cannot be established. Do you want
to continue with the install?”
Chapter 2. Installation 27
4. Locate WebSphere Application Server Developer Tools for Eclipse and
click Download for your version of Eclipse.
5. Locate the Install icon for WebSphere Application Server Liberty Profile, as
shown in Figure 2-2.
6. Select and drag the Install icon to your Eclipse workbench and drop it onto
your toolbar.
7. On the Confirm Selected Features page, expand the parent node and select
the features that you want to install.
The features available are:
– OSGi Application Development Tools
– Web Development Tools
– Web Services Development Tools
– WebSphere Application Server V8.5 Liberty Profile Tools
When you are finished, click Next.
8. On the Review Licenses page, review the license and if you agree to the
terms, click I accept the terms of the license agreement. Then, click
Finish. The installation process then starts.
“Warning: You are installing software that contains unsigned content. The
authenticity or validity of this software cannot be established. Do you want
to continue with the install?”
If you run the system disconnected from the Internet, Eclipse requires some
prerequisite files. For detailed instructions about how to perform this installation
and details about the additional prerequisite Eclipse files, see the following
Information Center website:
http://publib.boulder.ibm.com/infocenter/radhelp/v9/topic/com.ibm.rad.i
nstall.doc/topics/t_install_wdt.html
Chapter 2. Installation 29
Tip: During the configuration of the run time and server, you are prompted to
provide names for similar items, which can cause confusion. The following are
the names that you will be asked to define, in the order you encounter them:
Server Host Name The name of the machine running the server
or local host.
Server Name The name of the server as it will be known by
Eclipse. This should not be confused with the
actual server created in the Liberty profile.
Liberty Profile Server Name The name of the server that will be created in
the Liberty profile runtime environment. This
is your actual Liberty Profile Server.
The following steps for installing the Liberty profile and server assume that you
have already installed the tools that are described in 2.1, “Installing the
WebSphere developer tools” on page 26:
1. Start Eclipse with WebSphere developer tools installed (or Rational
Application Developer V9).
2. Select File New Other.
3. In the Wizards text box, type server. Select the Server icon and then click
Next, as illustrated in Figure 2-3.
Chapter 2. Installation 31
5. If you have already installed a Liberty profile runtime environment, you can
use the Browse button to select the Liberty profile runtime installation location
and continue with step 10 on page 34. This example does not have a Liberty
runtime environment that is installed, so you must install one. To do so, click
the Download or install link, as shown in Figure 2-5.
Chapter 2. Installation 33
7. On the Install Add-ons page, select any additional features that you want
added to your server installation. The additional features include open source
packages and the extended version of the Liberty profile, which adds extra
capabilities, including JMS and Web Services. Click Next, as shown in
Figure 2-7.
Note: If you obtained an edition other than the developers edition, the file
name contains your edition name rather than developers.
The server is installed into a wlp directory within the install directory that is
specified in step 5. If you did not specify an installation location, it installs to the
current directory.
Chapter 2. Installation 35
Creating a server
The Liberty profile runtime environment does not come with a server defined. To
create a server, you must run the following command from the Liberty profile bin
directory (wlp/bin):
server create <server name>
This creates a server, with the provided name, in the usr/servers directory.
Tip: A Liberty profile runtime environment can contain multiple servers. You
do not need to install multiple run times onto a machine to run
multiple servers.
Adding the new server and runtime environment into the tools
To use the Liberty profile developer tools with your new runtime and server, you
must add them into the tools. This can be done by following the instructions in
2.2.1, “Installation using the Liberty profile developer tools” on page 29. Then,
select your run time and server at the relevant steps.
Example 2-1 Error adding Liberty profile to existing WebSphere Application Server
installation on z/OS
CRIMA1155E ERROR: Error modifying.
ERROR: The WebSphere Application Server and WebSphere Application
Server Liberty Profile features cannot be added to or removed from an
existing package group after installation.
Chapter 2. Installation 37
Runtime directory structure
Figure 2-9 provides an overview of the directory structure that is used by the
Liberty profile runtime environment. The directory structure and location of files
are essential for the healthy running of your servers.
Chapter 2. Installation 39
logs
Contains the logs that are produced by the Liberty profile server. By default,
this is the place where the trace or message logs are written. It also contains
the First Failure Data Captures (FFDC).
resources
Contains additional resources for the Liberty profile server instance. For
example, keystores that are generated by the Liberty profile server are in
this directory.
tranlog
Contains the transactional logs that are produced by the server run time and
the applications. The transactional logs are used to commit or roll back
transactional resources in the event of server failure.
workarea
Contains the Liberty profile server operational files; is created during the first
server run.
http://www-01.ibm.com/support/docview.wss?rs=180&uid=swg27028175
The following sections describe the ways that you can define which JRE is used.
Caution: If you created a server.env file that defines the JRE (either for the
server or for the run time) this takes preference over the Eclipse setting. You
must remove this file in order for the Eclipse setting to work.
Chapter 2. Installation 41
2.3.2 Configuring the system JRE
When starting the Liberty server using the command line, the server must know
where to find its JRE. In the absence of any server or runtime configuration files
that define the JRE, the system JRE is used.
On Windows systems, you can use Example 2-2 to set the JAVA_HOME
property, so the Liberty server uses your own JRE installation directory.
On Linux Systems, you can use Example 2-3 to set the JAVA_HOME property.
The Liberty profile runtime environment searches for the Java command in the
following order of properties: JAVA_HOME, JRE_HOME, and PATH.
To define the JRE, add the following line into the server.env file:
JAVA_HOME=<path to your JRE>
You can use the server.env file to provide any other additional environment
variables that your server might need.
When you install the Liberty profile, this configuration file does not exist, so you
must create it. Create the file in one of the following locations:
${wlp.install.dir}/etc/jvm.options
The settings here apply to all servers in the run time.
${server.config.dir}/jvm.options
These settings are specific to the server containing the file. This jvm.options
file is used in preference to one at the runtime level when both exist.
2.4.1 Starting and stopping the server using the command line
The server can be controlled from a single server command that is in the
${wlp.install.dir}/bin directory. The following commands can be used to start
and stop the server:
server start <servername>
Starts the server running in the background
server run <servername>
Starts the server running in the foreground and writes the console output to
the window. To stop the Liberty profile server in this mode, press Ctrl+c or kill
its process or run server stop from another command window.
server debug <servername>
Starts the server in debug mode.
Chapter 2. Installation 43
server stop <servername>
Stops the server.
server status <servername>
Displays the current state of the server.
Hint: If workbench is open and it has the Liberty profile server already defined,
it automatically updates. Updates reflect the status of the server and show the
output from the server in the console window.
Liberty profile supports the Java EE Servlet 3.0 API. This book assumes some
knowledge of Java EE technologies, so the actual coding of the example servlet
is not described here.
The Liberty profile developer tools provide a rich development environment for
building web applications. In this section, we take you through the end-to-end
process of developing, deploying, and updating an application.
Getting started
Before you begin, make sure that you have installed the Liberty profile server
and tools as described in 2.1, “Installing the WebSphere developer tools” on
page 26. The following steps outline how to create a new project for later
deployment:
1. Begin by creating a web project in the Liberty profile developer tools by using
the Create a Web Project wizard from the toolbar, as shown in Figure 3-1 on
page 47.
2. In the first window, give the project the name ITSOWeb and select the
Simple project template. Leave Programming Model as the default value,
Java EE. Clicking Next takes you to the Deployment options.
3. Under Target Runtime, make sure that WebSphere Application Server V8.5
Liberty Profile is selected. Leave all other options as the default values, and
click Finish. Accept the option to switch to the web perspective if you are
prompted to do so.
2. After finishing the wizard, the HelloITSO.java file is included in the ITSOWeb
project. Open the file and add some simple output to the servlet’s doGet
method. Figure 3-3 shows an example doGet method.
Result: Note the extreme speed of the application start and that it was
automatically assigned the context root matching the project name of
ITSOWeb.
The procedure for creating and deploying a JSP in the Liberty profile developer
tools is similar to the procedure for a servlet. Complete the following steps:
1. Begin by creating a new JSP file by right-clicking the ITSOWeb project and
selecting New JSP File.
2. Enter ITSOWelcome.jsp for the name of the page and click Next.
3. On the Select JSP template window, make sure that the template New JSP
File (HTML) is selected and click Finish.
4. The ITSOWelcome.jsp page automatically opens in the Rich Page editor. By
default, the editor displays a split view that shows both the JSP source and a
preview of the output.
Insert some text into the source editor between the body tags. Notice that the
preview pane is automatically updated. Figure 3-5 on page 51 shows the JSP
editor after adding a form to submit a simple input value to the
HelloITSO servlet.
The Rich Page editor contains several powerful features that are beyond the
scope of this book. For more information, see the following Information
Center website:
http://publib.boulder.ibm.com/infocenter/radhelp/v9/topic/com.ibm.et
ools.rpe.doc/topics/crpe.html
For more information about JSF and the features it provides, see the
following website:
http://pic.dhe.ibm.com/infocenter/wasinfo/v8r5/topic/com.ibm.websphere.
nd.multiplatform.doc/ae/cweb_javaserver_faces.html
Feature enablement
To reduce the impact and resource usage, the Liberty profile server enables only
features that are actively being used. When you create a server using the Liberty
profile developer tools, the configuration automatically is updated to enable
servlets and JSPs. By default, the JSF application run time is not enabled. The
server configuration must be updated to run JSF applications.
You can verify that this took place by opening the server.xml file and confirming
that <feature>jsf-2.0</feature> was added. Also, the console output shows
that the jsf-2.0 and beanvalidation-1.0 features were installed to the server, as
shown in Figure 3-9.
Figure 3-10 shows the ManagedBean configuration after the wizard finishes.
Now that the managed bean is added, complete the following steps to edit the
userManagedBean class:
1. Open the UserManagedBean class for editing.
2. Add String fields named user and location.
3. Add a getter and setter for both fields.
4. Add a method named clear that sets both fields to null and returns the
string “clear”.
To further edit the properties of the managed bean, complete the following steps:
1. Go back to the Faces Config editor for the managed bean. You can set initial
values for the managed bean’s properties by clicking Add under the
Initialization section.
2. From the property name drop-down menu, select the Name property. In the
value field, enter Liberty User (Figure 3-12 on page 57).
3. Repeat the process for the location property. In the value field, enter Liberty
User Location.
The input.jsp file asks for two input parameters, a name and a location. The
values are taken from the managed bean userManagedBean. Figure 3-13 shows
example code to accomplish this process.
The goodbye.jsp file outputs the name and have a command button that allows
you to start over. Example code is shown in Figure 3-15.
Result: Notice how the managed bean fields were initialized without having to
add code in the JSP. Also, notice that the application navigates to the correct
pages based on the navigation rules without having to embed navigation logic
in the JSP files.
2. After you select the check box next to JAX-RS (REST Web Services), you
see a red circle below the window with a note that further configuration
is required.
3. Clicking the note opens a window with various configuration options for
JAX-RS. You can leave all of the values on this window as their defaults and
click OK. If you open the web.xml file for the web project, you notice that a
servlet and servlet mapping were added for JAX-RS.
Feature enablement
Enabling the facet prompts you to enable the jaxrs-1.1 feature on the server. As
with JSF, the Liberty profile server does not load the JAX-RS run time unless it is
actively being used. Click Yes to enable the feature. If you load the server.xml
file, in the source view, you notice that <feature>jaxrs-1.1</feature> now is
added to the list of feature definitions.
Note: When you access web applications with JAX-RS enabled, you might
see the error, which is shown in Example 3-1, displayed in the console output.
This message does not represent a functional error and can be safely ignored.
CDI also helps manage the lifecycle of beans through annotations. Beans can be
defined to live for the life of a request, session, application, or conversation.
For more information about CDI, see the following Information Center website:
http://pic.dhe.ibm.com/infocenter/wasinfo/v8r5/topic/com.ibm.websphere.
zseries.doc/ae/cweb_cdi.html
Use the procedure that is outlined in the rest of this section to create a simple
faces application that uses JavaBeans that are injected by CDI.
The InjectedBean class should contain one method, getHello(), which simply
returns the string “Hello from the injected bean”. The completed class should
look like the example in Figure 3-22 on page 65.
The completed class should look like the example in Figure 3-23.
Result: You should see the output (Hello from the injected bean). Your
web application did not have to directly instantiate either the ExampleBean or
the InjectedBean class.
Use the procedure that is outlined in the rest of this section to create a web
application that uses the JMS publish and subscribe model. If you are using
Liberty core edition, you cannot compile this application in the Liberty profile
developer tools because the API JAR files for JMS are not available.
2. In the details window for the JMS topic, enter ITSOTopic in the id field and
jndi/ITSO_TOPIC in the JNDI name field.
3. The configuration must also indicate whether the JMS Topic uses the
WebSphere embedded messaging engine or an external instance of
WebSphere MQ. To accomplish this task, select the JMS Topic in the server
configuration and click Add.
4. In the Add Item dialog box, select WebSphere Embedded JMS Topic. The
details window allows you to specify various properties for the Topic, but for
this example you can leave all the values at their defaults.
Enabled features
When you create JMS resources, the Liberty profile developer tools likely prompt
you to add features to the server. For this example, wasJmsClient-1.1 and
wasJmsServer-1.0 must be enabled. You can enable these features manually by
selecting Feature Manager in the server configuration. Click Add and select the
JMS features to add, as shown in Figure 3-25 on page 69.
If you are developing the servlet code yourself, complete the following steps:
1. Add a constant named TOPIC_CONNECTION_FACTORY_JNDI_NAME with a value
that is equal to the JNDI name that you specified for the JMS topic connection
factory, jndi/jmsTCF.
Result: You should see the message Received message: Hello, subscriber
in your web browser. This simple example shows that JMS APIs can be used
to transmit messages between a client and server. In this case, the client and
server are both in the same servlet. In 5.4, “Developing message driven bean
applications” on page 126, we show how you can add a Message Driven Bean
(MDB) as a client by using these same resources.
Complete the actions outline in the following sections to expose a Java class as
a web service in WebSphere Liberty profile.
Create a Java class in the ITSOWeb project named ITSOGreeter. It should have
one method, named getValue, that takes a String as an input. It should return the
String Hello, <name> from the ITSO Greeter. The completed ITSOGreeter
class is shown in Figure 3-27 on page 73.
6. Click Next to advance to the next window. The second window has many
options for the generated web service. If you plan to use this example code as
a starting point for the example in 6.5, “JAX-WS security” on page 162, select
the check box next to Generate WSDL file into the project. This step is
optional as the example in this chapter works with or without a generated
WSDL file, and the file can be generated later if needed.
7. Accept all of the defaults for other options and click Next to advance to the
next window.
Caution: The code in the client project is generated to use JAX-WS APIs
that are not available in JavaSE 6. If you are using JRE Version 6, you
might need to change the order of dependencies on the project’s build path
so that the Liberty profile runtime dependency is above the
JRE dependency.
Result: You should see the output Hello, JAX-WS Client from the
ITSO Greeter.
These characteristics of the Liberty profile ensure that developers can write,
debug, and update applications without wasting time on server restarts or
updating configuration through a complex administrative interface.
Some of those listed features also provide other features. For example, the
jsp-2.2 feature contains the servlet-3.0 feature. If your server configuration has
jsp-2.2 enabled, it does not need to have servlet-3.0 additionally specified to
run servlets.
When you add or remove a feature, the run time is dynamically updated to
enable or disable the function. You can test this by deploying a simple servlet
and removing the servlet-3.0 feature from the configuration. When you remove
the feature, you see the text in Example 3-3 in the console output.
This behavior can be seen by updating the web.xml file for a deployed Web
Archive (WAR). Make a change, such as changing the value of a servlet
mapping, and save the file. Then, load the servlet using the new mapping, and
observe that the application is automatically updated.
Before using JNDI, you must add the JNDI-1.0 feature to your
server’s configuration.
To test this, create a simple servlet and add code similar to that shown in
Figure 3-32.
Save the file and without restarting the server, run the servlet again. Notice that it
now prints out the value that was set in the server configuration. You can also
test updating the value or removing the jndiEntry element. In each case, the
server is dynamically updated without a restart.
The following list shows the API JAR files that are used for technologies that are
covered in this chapter:
Servlets
dev/api/spec/com.ibm.ws.javaee.servlet.3.0_1.0.0.jar
JSP
dev/api/spec/com.ibm.ws.javaee.jsp.2.2_1.0.0.jar
JSF
dev/api/spec/com.ibm.ws.javaee.jsf.2.0_1.0.0.jar
dev/api/spec/com.ibm.ws.javaee.jsf.tld.jar
dev/api/spec/com.ibm.ws.javaee.jstl.1.2_1.0.0.jar
Caution: Only spec and ibm-api libraries are visible to applications by default.
See 3.3, “Controlling class visibility in applications” on page 88 for more
information about class visibility.
Liberty profile enables building with Maven by providing a plug-in that can be
used for common administrative tasks and a repository that contains certain API
JAR files.
<url>http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasd
ev/maven/repository/</url>
<layout>default</layout>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>
Creating a server
Use the following command to create a server named SERVER_NAME in the
directory SERVER_HOME:
mvn liberty:create-server -DserverHome=SERVER_HOME
-DserverName=SERVER_NAME
The server must be started to remove the application. In this scenario, the
appArchive parameter uses the application name rather than a file path.
Dependency repositories
The API JAR files that are in the dev/ibm-api directory underneath the Liberty
Profile Server home directory are also available in a public Maven repository. To
use the repository, add the repository definition in Example 3-10 to your
pom.xml file.
<url>http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasd
ev/maven/repository</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
Java EE dependencies, such as the servlet API, are not available in the IBM
repository. These dependencies can be accessed using the repository definition
in Example 3-12.
The dependency definition in Example 3-13 shows how to reference the Java EE
6 API.
ANT plug-in
The Liberty profile ANT plug-in is in the dev/tools/ant directory under the server
home directory. To use the plug-in, you must make it available on the class path.
To make the plug-in available, copy the plug-in JAR file to the lib directory of the
ANT installation and reference it using an antlib namespace, as shown in
Example 3-14.
A library, in the Liberty profile server, is composed of a collection of file sets that
reference the JAR files to be included in the library. The library can be used in an
application by creating a classloader definition for the application in the server
configuration. The application classloader can share the in-memory copy of the
library classes with other applications, or it can have its own private copy of the
classes that are loaded from the same location.
Look at the source view for the server.xml file. The application now contains a
classloader, which contains a library, which contains a file set. Example 3-16
shows the resulting configuration from the server.xml file.
Caution: The Liberty profile developer tools use slightly different terminology
than the server configuration file. A library in the tools is equivalent to a
privateLibrary in server.xml. A shared library in the tools is equivalent to a
commonLibrary in server.xml.
Example 3-17 shows the definition of a shared library that is used by two different
applications. Both applications share an in-memory copy of the classes.
Example 3-17 Definition of two applications using the same shared library
<library id=”loggingLibrary”>
<fileset dir=”${server.config.dir}/logger”
includes=”ITSOLogger.jar”/>
</library>
The libraries in these directories are used by all applications that do not
specifically define a classloader. If you define a classloader for an application,
the global library classes is not available unless you add the library global as a
shared library. The sample configuration in Example 3-18 shows an application
that is configured to use the global shared library.
For more information, see the OSGi home page at the following website:
http://www.osgi.org
The OSGi support in the WebSphere Application Server Liberty profile is based
on the Apache Aries open community project.
In the manifest editor, click the Runtime tab. In the exported packages pane,
click Add. Select the com.itso.example.osgi.api package from the list and then
click OK.
The client must be configured so that it can recognize the service implementation
and have the service dependency that is injected into the helloService field. This
is done by creating a Blueprint file for the client using the following steps:
1. Create a Blueprint file by right-clicking the ITSO.OSGiExample.Client project
and selecting New Blueprint File. You can accept all default values for the
file and click Finish.
2. Add a reference element to the Blueprint:
a. Click Add in the Overview pane in the Blueprint editor.
b. Click Reference and click OK.
c. Click Browse beside the Reference Interface field, and select HelloAPI
from the list of classes.
d. In the Reference ID field, enter helloRef.
e. Click OK to finish adding the reference element.
3. Add a bean element to the Blueprint file:
a. Click Add in the Overview pane.
b. Select Bean and click OK.
c. Click Browse, select HelloITSOClient, and click OK.
Figure 4-5 Output after adding the OSGi application to the server
You do not see any output in the browser (unless you added output in the
servlet’s doGet method) but you see the message Hello, Liberty developer
displayed in the console output. This message shows that the servlet
successfully retrieved the service from the service register in its init method
and started the service’s sayHello method in its doGet method.
Enterprise bundle archive (EBA) files can be placed in the dropins directory, such
as EAR or WAR files. You can also define them explicitly using an application
element in the server.xml file.
Also, note that you might need to manually enable the features blueprint-1.0
and wab-1.0 in the server configuration.
As described in 3.2.7, “Using Maven to automate tasks for the Liberty profile” on
page 83, you can use the Liberty Maven plug-in to automate tasks. Some
examples of these tasks are deploying applications and starting a Liberty profile
server.
The EBA Maven plug-in allows you to build EBA archives from component
bundles. It can automatically generate an Application Manifest file from
information that is contained in the Maven pom file. For more information about
the EBA Maven plug-in, see:
http://aries.apache.org/modules/ebamavenpluginproject.html
File sets
A file set is simply a collection of files. They have several purposes in Liberty
profile. In the context of data access, they are used to point to the JDBC driver
library files provided by a database vendor.
Shared libraries
As described in 3.3, “Controlling class visibility in applications” on page 88,
shared libraries provide a collection of classes that can be used by one or more
applications or data sources. Libraries are composed of file set elements that
define the location of the class files.
JDBC drivers
A JDBC driver definition references a shared library. You can optionally specify
individual classes from the vendor-provided JDBC driver library to be used as the
data source implementation. If you do not specify the implementation classes,
the Liberty profile server infers the appropriate class name for most
common databases.
Data sources
A data source is the key piece of configuration for data access in the Liberty
profile server. In the simplest case, a data source is composed only of a JDBC
driver and the JNDI name where the data source is made available. In more
complex scenarios, you can specify other properties such as the type of data
source, transactional behavior, or vendor-specific database properties. For more
information about the various configuration options available for data sources,
see the following information center website:
http://pic.dhe.ibm.com/infocenter/wasinfo/v8r5/topic/com.ibm.websphere.
wlp.nd.doc/ae/twlp_dep_configuring_ds.html
4. A JDBC driver requires a shared library that references the JDBC driver
implementation classes. Beside the Shared libraries reference field, click New
to create a shared library. This opens a window to configure a shared library,
as shown in Figure 5-3.
5. Now, create a new file set for the shared library by clicking Add next to the
input field for Fileset reference. This opens the Fileset Details window.
6. Enter the directory where the JAR files for your JDBC driver are in the Base
directory field, or click Browse to select a directory, as shown in Figure 5-4.
7. Right-click the Data Source element under the Configuration Structure and
select Add Derby Embedded Properties.
8. In the Properties window, select Create in the Create database
drop-down menu.
9. Also, in the database properties window, enter ITSO in the Database name
field.
10.Save the server.xml file. The data source is now available for applications.
To create the data source in the tools, complete the following steps:
1. Begin by loading the web.xml file. In the design view, select the Web
Application and click Add.
2. On the resulting window, select Data Source. Complete the properties for the
data source. For example, enter java:comp/env/jdbc/ITSODataSourceDD for
the name, org.apache.derby.jdbc.EmbeddedDataSource for the class name,
and ITSODD for the database name.
3. Now, click the new data source in the window on the left, and click Add.
Select Property to add a property. In the property editor, enter
createDatabase in the name field and create in the value field.
4. Save the deployment descriptor. If the server is running, the data source is
now available to your applications.
Example 5-6 shows how the completed data source appears in the web.xml file.
Caution: When importing entire projects from the additional materials, some
of the examples for later sections might have compile errors. For example, the
class MongoServlet has compile errors until you add the MongoDB JDBC
driver to the project’s class path, as described in “Setting up the MongoDB
JDBC driver” on page 130.
Note: Because of database differences, the create table statement might not
work for all databases.
Each servlet can be tested using the JSP page dataSource.jsp that is included
in the additional materials. To access the page, visit:
http://localhost:9080/ITSOWeb/dataSource.jsp
You can find a list of data source properties and their associated configuration
update behaviors at:
http://pic.dhe.ibm.com/infocenter/wasinfo/v8r5/topic/com.ibm.websphere.
wlp.nd.multiplatform.doc/ae/rwlp_ds_config_updates.html
The rules noted apply only to data sources that are defined in the server
configuration. When you update the properties of an application-defined data
source, the entire data source is destroyed and the updated application uses a
new data source. Effectively, from a developer perspective, all of the changes
take place immediately.
4. Click Next to advance to the next window. Under Table name, clear the Use
default check box. Enter USERTBL in the Table name field. Add an entity
field by clicking Add. Click Browse next to the Type field to select
java.lang.String, enter location in the name field, and then click OK.
5. Repeat step 4 to add entities for a java.lang.String field named name and a
java.lang.Integer field named id. Select the check box in the Key column for
the row containing the id field to indicate that the field is the primary key for
the table.
6. To see automated changes, open the Persistence XML editor in either the
design or source view. Notice that the persistence class for UserEntity was
automatically added to the persistence.xml file. Now, open the source for the
UserEntity class. Notice that the id field is annotated with the
javax.persistence.Id annotation to indicate that it is the primary key.
7. The Derby database that we use is automatically generating the id field. For
JPA to handle the generated id field correctly, it must be annotated with
javax.persistence.GeneratedValue. The strategy attribute for the annotation
should be set to GeneratedValue.IDENTITY. Figure 5-10 on page 119 shows
how the annotation should look.
8. Open the persistence.xml file again in the design editor. Click the ITSOWeb
persistence unit. In the details window, enter jdbc/ITSO in the JTA data
source field.
9. Add a persistence context reference to the deployment descriptor. Open the
web.xml file in the design editor. Right-click the Web Application (ITSOWeb)
element and select Add Persistence Context Reference. In the details
window, enter jpasample/entitymanager in the Persistence Context
Reference Name field and ITSOWeb in the Persistence Unit Name field.
10.Create a utility class to handle the actual persistence by right-clicking the
project and selecting New Class. Enter com.itso.example for the package
name and Persistor for the class name. In the source editor, create two
methods: retrieveVisitors and persistVisitor.
The retrieveVisitors method looks up an entity manager using the JNDI name
java:comp/env/jpasample/entitymanager. It then uses the EntityManager to
run a query that selects all UserEntity objects and returns the results.
The persistVisitor method accepts two String arguments, username and
location. It first looks up a UserTransaction object and starts the begin
method to start a global transaction. The method then creates a new
UserEntity object using the username and location variables. It then looks up
the EntityManager and persists the UserEntity object. Finally, the commit
method is started on the UserTransaction to commit the transaction.
11.Create a front end for the JPA application. Begin by creating a JSP file named
jpaInput.jsp. The JSP contains a form with two input fields and a Submit
button. Figure 5-12 on page 121 shows the completed JSP file.
The following list notes the key steps for creating a JPA application outside of the
Liberty profile developer tools environment:
Creating the UserEntity class that maps to the database table USERTBL.
Creating the persistence.xml file.
Adding a persistence context reference to the deployment descriptor.
As with other types of applications, the dynamic nature of the Liberty profile
server speeds up application development by allowing you to make iterative
updates to your JPA application without having to restart the application
or server.
2. You can also add it manually by selecting Feature Manager in the server
configuration, clicking Add, and selecting ejbLite-3.1.
Result: You should see the output Hello, ITSO EJB in your web browser. This
shows that the EJB was automatically injected into the statelessBean field and
that the servlet was able to successfully start the method hello.
You also must add properties to the JMS activation specification to indicate that
you are using the embedded messaging engine and to specify the JMS Topic to
be used. To do this, complete the following steps:
1. Click JMS Activation Specification in the server configuration and
click Add.
2. Select WebSphere Embedded JMS Activation Specification in the dialog
box.
3. On the details window for the properties, enter ITSOTopic in the Destination
reference field. In the Destination type field, change the drop-down value so
that it reads javax.jms.Topic.
Enabling features
After saving the message driven bean class and resources, the Liberty profile
developer tools should automatically prompt you to enable the jmsMdb-3.1
feature. To add this feature manually, complete the following steps:
1. Select Feature Manager in the server configuration.
2. Click Add, and select the jmsMdb-3.1 feature.
Creating an application
To test the MongoDB setup, we create a web application with two parts. A JSP
file is used to display an input form, and a servlet is used to interact with the
MongoDB instance and return results. Complete the following steps:
1. Begin by creating a JSP file named mongoInput.jsp in the ITSOWeb project
by using the New JSP File wizard. On the template selection page, choose
New JSP File (html).
It is beyond the scope of this book to describe all aspects of security and how to
configure them. For more information about security and how to implement
specific security models not covered by this chapter (such as LTPA or SSO) see
the Information Center at the following website:
http://pic.dhe.ibm.com/infocenter/wasinfo/v8r5/topic/com.ibm.websphere.
wlp.nd.doc/ae/twlp_sec_webappsecurity.html
The keystore and certificate can be created either by using the WebSphere
developer tools or from the command line. For development, you usually use a
self-signed certificate, as shown in our examples.
Figure 6-1 Selecting to crete the SSL Certificate using WebSphere developer tools
3. You are prompted to create a password for your keystore and optionally set
the validity period or subject for the certificate, as shown in Figure 6-2 on
page 139.
4. Enter the required values and click Finish. The Console window shows the
output of the command, as shown in Figure 6-3.
8. In the Add Feature dialog, select ssl-1.0 from the list and click OK.
9. On the left side of the Feature Manager window, you see the Configuration
Structure being displayed. To add in the keystore, select Server
Configuration and click Add, as shown in Figure 6-5.
Creating keystore
C:\Liberty\v85Runtime\usr\servers\myThirdServer\resources\security\key.
jks
<featureManager>
<feature>ssl-1.0</feature>
</featureManager>
<keyStore id="defaultKeyStore" password="{xor}Lz4sLChvLTs=" />
This section assumes that you are starting with the web application created in
Chapter 3, “Developing and deploying web applications” on page 45. If you do
not have this application in your project workspace, you can find a completed
version included in the download material for this book. For more information see
Appendix A, “Additional material” on page 215.
To access and edit the available web applications to work with HTTPS redirect,
complete the following steps:
1. In Project Explorer, expand your web application and right-click the
deployment descriptor. Select Open With Web Application 3.0
Deployment Descriptor EditorIf you do not see Web Application 3.0
Deployment Descriptor Editor in the menu, select Other and select the
correct editor.
2. To enable HTTPS redirect, add a security constraint to your application. To
do this, select Web Application in the Overview section and then click Add,
as shown in Figure 6-6 on page 143.
3. In the Add Item window, scroll down and select Security Constraint, then
click OK.
4. The Security Constraint now appears in the Overview section. Next, define
the Web Resource Collection for the Security Constraint. This identifies which
addresses are covered by the Security Constraint. Expand the Security
Constraint in the Overview section and select Web Resource Collection.
6. Next, specify the details of the Security Constraint. In the Overview section,
select Security Constraint. The details window now allows you to define the
Security Constraint.
7. Give the Security Constraint a name. Under the User Data Constraint section,
select CONFIDENTIAL for the transport guarantee, as shown in Figure 6-8
on page 145. This specifies that we allow only secure communication with the
web resource collection.
8. Our example currently applies the HTTPS redirect to all communications with
the addresses defined in the Web Resource Collection. To apply this redirect
to only specific HTTP methods, right-click the Web Resource Collection in
the Overview section and select Add HTTP Method. We restrict our
HTTPS redirect to GET requests only by entering GET for the HTTP Method.
9. The next step is to enable application security. In the server view, expand the
server until you see the Feature Manager entry. Double-click the Feature
Manager or right-click and select Open.
10.The Feature Manager window opens. Click Add, select appSecurity-2.0
from the list, and click OK.
11.HTTPS redirect is now fully configured. Save your changes and WebSphere
Developer Tool automatically updates the server with the new version of your
application. If you now attempt to access the application at
http://localhost:9080/ITSOWeb/HelloITSO, you notice that you are always
redirected to https://localhost:9443/ITSOWeb/HelloITSO.
This section expands on the HTTPS redirect example in 6.2, “HTTPS redirect” on
page 142.
Use the following steps to create and define the registry for authentication using
a Basic User Registry:
1. Update the server.xml configuration file with the form login configuration.
Open the server view in your workbench and double-click the Server
Configuration for your server. This opens your server.xml file. Switch to the
design tab if it is not already selected.
2. In the Configuration Structure section on the left, select the Feature
Manager. The Feature Manager details are displayed on the right, as shown
in Figure 6-9 on page 147.
3. If the appSecurity-2.0 feature is not already in the list of features, click Add
and select the appSecurity-2.0 feature.
4. We add the basic registry that is used for our authentication. Under the
Configuration Structure, select Server Configuration and click Add, as
shown in Figure 6-10.
7. Now that we have our basic user registry, we must add users and groups to it.
Click Add.
8. In the resulting window, select User and click OK.
9. A user object now appears under your basic user registry. Click the user
object. On the right, under User Details, enter a user name of User1 and then
click Set to enter a password, as shown in Figure 6-12.
10.Enter the password and click OK. You have now created a user for the basic
registry. Repeat the process and add another user that is called User2.
11.Then, add a security group to the basic user registry. Select the Basic User
Registry and click Add....
12.Select group from the Add Item window and click OK.
13.A group element appears under your basic user registry. Ensure that it is
selected and under Group Details enter Group1 as the group name.
Use the j_username input field to obtain the user name and use the j_password
input field to obtain the user password.
When a user requests a webpage that requires authentication, the web server
stores the original request and displays the login form. When the login form is
completed and the user is successfully authenticated, the web server redirects
the call to the original request.
The form logout page is an HTML or JSP file that you include with your web
application. This logout page contains a form with a special post action.
Example 6-4 provides an example of a logout.jsp file.
The logoutExitPage specifies where the user is to be redirected after logging out.
Note: The realm name is an optional attribute that is used for differentiating
between different repositories. If you have multiple repositories in your
server, each one can have a realm name. You can then use the realm
name to identify the repository to use for authentication. If you have only
one repository, you can leave this value blank.
6. In the detail section, under Authorization Constraint, click Add to the right of
the Role Name. This adds a role that is required for access to the resource.
Give the role a name, as shown in Figure 6-17 on page 155.
Note: The Role Name within your application is a logical name and can be
any value that you like. In 6.3.3, “Defining bindings between the application
and the server” on page 155, you add mappings between your application
roles and the users and groups that are defined in your user registry.
7. The application changes are now complete. Save all the changes.
7. Map the security role with the users and groups that are to be considered part
of this role. In our example, we are going to map Group1 to the
AuthorizedManager role. Select the security-role under the Configuration
Structure and click Add.
Note: As well as user and group, you can also select the special-subject
option to assign access to either everyone or all authenticated users.
9. Select the Group element in the Configuration Structure and under Group
Details enter the name of the group that is to be allowed access to the
resource, as shown in Figure 6-20.
If you now access your application, you are taken to the login window. When you
enter the user credentials, only User1, which is in Group1, has access to
the application.
You can enable JMS security by manually editing the list of features in the server
configuration file to add wasJmsSecurity-1.0. You can also enable the feature in
the WebSphere developer tools by loading the server configuration editor and
adding the wasJmsSecurity-1.0 feature to the feature manager.
After you enable the JMS security feature, you must authenticate with an
authorized user to access any JMS resources.
To authenticate within the server configuration, you edit the properties for the
JMS Topic Connection Factory or JMS Queue Connection Factory to specify a
user name and password. Example 6-6 shows the configuration in the
server.xml file.
2. Now select Role underneath Messaging Security. In the details window, enter
a name such as developer in the Role name field. With Role still selected,
click Add to add a user. In the User details window, enter a user name from
your user registry, such as User1.
3. Add permissions for the role by selecting Role, clicking Add, and selecting
Topic Permission. In the Action field of the details window, you can
configure whether the user is authorized to send messages, receive
messages, or both. Add an action by clicking the Add button next to the
Action field. This adds a value of SEND to the field. You can change this
value to RECEIVE or ALL by changing the value of the drop-down field.
You can also manually edit configurations. Example 6-7 shows the configuration
that must be added to the server.xml file for manual editing.
Message level security allows you to secure SOAP messages that are
exchanged between web service clients and web service providers using
WS-Security standards. WebSphere Liberty profile supports the following web
service standards:
Web Services Security SOAP Message Security 1.1
Web Services Security Username Token Profile 1.1
Web Services Security X.509 Certificate Token Profile 1.1
WS-SecurityPolicy 1.3
This section provides an example of how to secure a web service using SSL at
the transport layer and Username Token authentication at the message layer.
For more information about other ways to secure web services, see the following
Information Center website:
http://pic.dhe.ibm.com/infocenter/wasinfo/v8r5/topic/com.ibm.websphere.
wlp.doc/ae/cwlp_wssec.html
This example builds on the JAX-WS example in 3.1.7, “Developing JAX-WS web
services applications with the Liberty profile developer tools” on page 72. Before
you begin, make sure that you enabled SSL by creating a keystore, as described
in 6.1, “Enabling SSL” on page 138. Also, make sure that the appSecurity-2.0
feature is enabled.
3. You must also enable HTTPS redirect for the pattern /ITSOGreeterService so
that requests to the web service over HTTP are redirected to the SSL port
using HTTPS. To accomplish this task, use the procedure in 6.2, “HTTPS
redirect” on page 142. After enabling redirect, test that it is working by visiting
the following link:
http://localhost:9080/ITSOWeb/ITSOGreeterService?wsdl
You should be redirected to the following ULR:
https://localhost:9443/ITSOWeb/ITSOGreeterService?wsdl
You should see the contents of the WSDL document.
4. To enable the web services security run time, you must enable the
wsSecurity-1.1 feature in the server configuration.
5. To configure the JAX-WS run time to send a Username Token with web
service client requests, you can add a wsSecurityClient element to the
server configuration. When it is specified, the WS-Security client configuration
becomes the default configuration for all web services clients on the server.
The configuration might be overridden programmatically by passing in
property values on the RequestContext in the client code. Example 6-9 shows
an example WS-Security client configuration.
10.You can attempt to test these changes now by visiting the link
http://localhost:9080/ITSOWebClient/JAXWSGreeterClient. However, the
test fails because the client does not send a user name token.
11.Now, make the same changes that were made to the provider WSDL to add
the WS-Security policy and update the address to the client WSDL in the
ITSOWebClient project. After making these changes, you can again try
visiting the test client. This time, you should see the output Hello, JAX-WS
Client from the ITSO Greeter that indicates that the service was
successfully started.
In container managed security, you edit the server configuration to specify a user
name and password for the MongoDB instance. Example 6-13 shows how you
specify the user name and password in the server.xml file.
The log shows the server startup procedure. First, the kernel starts. Then, the
feature manager initializes and reads the configuration from the server.xml file.
The server is configured to listen on a given port. Then, the ITSOWeb application
is started and finally the server is ready to serve the application.
To learn more about configuring the logging service, refer to the information
center at the following website:
http://pic.dhe.ibm.com/infocenter/radhelp/v9/topic/com.ibm.websphere.wl
p.nd.multiplatform.doc/ae/rwlp_logging.html
The Logging Details window allows you to configure many aspects of logging,
including the location of the logs and where they are stored. The Trace
Specification defines what information to capture in the logs. In our example,
we capture information level messages for all classes. In addition, we chose
to capture all debug or higher level messages for any
com.itso.example.* classes.
For information about how to add logging to your applications, refer to the
following WebSphere Application Server Information Center website:
http://pic.dhe.ibm.com/infocenter/wasinfo/v8r5/topic/com.ibm.websphe
re.nd.multiplatform.doc/ae/ttrb_javalogapps.html
The result file that is generated by the dump command contains server
configuration, log information, and details of the deployed applications in the
workarea directory. The dump command can be used against a running or
stopped server. If the server is running, the following additional information
is gathered:
State of each OSGi bundle in the server
Wiring information for each OSGi bundle in the server
Component list managed by the Service Component Runtime (SCR)
Detailed information of each component from SCR
You can also create a memory dump of the Liberty profile server using the
WebSphere developer tools. This is done by right-clicking the server in the
Servers view and selecting Utilities Generate Dump for Support.
The Liberty profile offers the monitor-1.0 feature. This feature allows users to
track information about the Liberty profile server run time, such as JVM, web
applications, and the thread pool. To enable this monitoring, add the monitor-1.0
feature to the server.xml configuration so the following MXBeans are available:
WebSphere:type=JvmStats
WebSphere:type=ServletStats,name=*
WebSphere:type=ThreadPoolStats,name=Default Executor
For more information about monitoring the Liberty profile using MXBeans, see
the following Information Center website:
http://pic.dhe.ibm.com/infocenter/wasinfo/v8r5/topic/com.ibm.websphere.
wlp.nd.doc/ae/twlp_mon.html
You can also change the value of the updateTrigger attribute to mbean. This
allows you to update the application manually by using JMX.
To add plug-in configuration properties in the Liberty profile developer tools, load
the server.xml file in the Design editor and click the server configuration. Then,
click Add and select Generate Plug-in. You can specify properties such as ports
in the Generate Plug-in details window.
The actual plug-in configuration file must be generated either by using a utility in
the Liberty profile developer tools, or by running an mbean command using JMX.
In the tools, generate the file by right-clicking the server and selecting Utilities
Generate Web Server Plug-in.
To generate the plug-in configuration using mbean, use a JMX console, such as
jconsole, to connect to the server. The localConnector-1.0 feature must be
enabled on the server. From the console, start the defaultPluginConfig
generation MBean.
A Liberty profile image is an archive file that contains one or more types of
resources of the Liberty profile environment. The types are dependent on the
topology that is deployed. You can extract them manually or you can use an
extraction tool to deploy the file to one or more systems. Alternatively, you can
use the job manager in the WebSphere Application Server Network Deployment
product to deploy these images.
The package contains all of the binary files, server configuration, and
applications necessary to distribute the server.
For example, the full profile supports Java EE technologies such as Java EE
Connector architecture and the Java API for XML Based RPC (JAX-RPC), but
Liberty profile does not. For OSGi applications, Liberty profile does not support
Blueprint security.
For a more detailed comparison of technologies that are supported by the full
profile and Liberty profile, refer to the following information center website:
http://pic.dhe.ibm.com/infocenter/wasinfo/v8r5/topic/com.ibm.websphere.
wlp.nd.doc/ae/rwlp_prog_model_support.html
Class loading
The Liberty profile server provides different methods of controlling class visibility
than the full profile server. If your application requires you to configure advanced
class loading behavior, you might need to reconfigure class loading in the full
profile environment. You might also need to configure class loading in full profile
if your application embeds classes that conflict with the full profile run time. For
more information about class loading in full profile, see the following page in the
Information Center website:
http://pic.dhe.ibm.com/infocenter/wasinfo/v8r5/topic/com.ibm.websphere.
express.doc/ae/trun_classload.html
Data sources
Some data source properties have different names:
ifxIFX_LOCK_MODE_WAIT is informixLockModeWait in the full profile.
supplementalJDBCTrace is supplementalTrace in the full profile.
Connection Manager
Some of the connection manager properties have different names in the full
profile and Liberty profile. Table 8-1 shows the property naming differences.
maxConnectionsPerThread maxNumberofMCsAllowableInThread
maxIdleTime unusedTimeout
maxPoolSize maxConnections
minPoolSize minConnections
There are also differences in the way timeout values for immediate or never
(disabled) are specified. In Liberty profile, 0 represents an immediate timeout and
-1 represents a disabled timeout. In full profile, -1 represents an immediate
timeout and 0 represents a disabled timeout.
The value of the purge policy can also differ slightly between full profile and
Liberty profile. There are three possible values in Liberty profile: EntirePool,
FailingConnectionOnly, and ValidateAllConnections. The EntirePool option
maps directly to the EntirePool option in full profile. FailingConnectionOnly
maps to the FailingConnectionOnly option with the
defaultPretestOptimizationOverride property set to false in the full profile.
ValidateAllConnections corresponds to FailingConnectionOnly with the
defaultPretestOptimizationOverride property set to true in full profile.
Security
In the Liberty profile, you can configure user-to-role mappings and runAs users in
the application-bnd element of the server.xml file. In the full profile, you can
configure this only in ibm-application-bnd.xml/xmi.
The Liberty profile supports more policy assertions than the full profile. To sign or
encrypt a SupportingToken such as a UsernameToken in the Liberty profile, you
assert the token as SignedSupportingTokens,
SignedEncryptedSupportingTokens, or EncryptedSupportingTokens. In the full
profile, you must use an XPath expression to sign or encrypt a SupportingToken.
Some endorsing tokens are not supported in the full profile, including
EndorsingSupportingTokens, SignedEndorsingSupportingTokens,
EndorsingEncryptedSupportingTokens, and
SignedEndorsingEncryptedSupportingTokens.
The IncludeToken assertion is enforced in the Liberty profile, but is ignored in the
WS-Security runtime environment of the full profile.
Web applications
The Liberty profile server does not automatically expand web archive (WAR) files
that are deployed to the server. The Java EE specification states that the
getRealPath() method returns a null value if the content is being made available
from a WAR file.
JSP
Full profile supports a useInMemory configuration option to store only translated
JSP files in memory. Liberty profile does not support this option.
JAX-RS
The Liberty profile developer tools do not support third-party JAX-RS APIs. The
developer tools for full profile include this support.
Bean validation
There is no support for bean validation inside OSGi applications in Liberty profile.
The IBM Installation Manager is used to install the Liberty profile on z/OS using a
part of the com.ibm.websphere.zOS.v85 package offering.
This chapter walks through the creation, packaging, and deployment of a custom
feature in the following sections:
Considerations for creating custom features
Defining a custom feature
Liberty product extensions
Consider the following list before you choose to extend the Liberty profile
run time:
Depending on your needs, features can run directly on the Liberty kernel with
no dependence on application containers or other features. This provides a
lightweight solution.
Defining your own features can be powerful, but comes at the cost of
portability. If portability between application servers is a primary concern,
developing specification-compliant applications is more appropriate than
creating product extensions and features.
It is important to use only documented and supported externals to ensure that
the Liberty profile can be serviced or upgraded with minimal disruption to your
features and extensions. APIs, SPIs, and Javadoc are provided in the
${wlp.install.dir}/dev/ directory for use when developing and building
your features.
For more information about feature manifests, including the full list of all
supported manifest headers, see the following Information Center article:
http://pic.dhe.ibm.com/infocenter/wasinfo/v8r5/topic/com.ibm.websphere.
wlp.core.doc/ae/rwlp_feat_definition.html
Chapter 9. Developing and deploying custom features (new in Version 8.5.5) 193
Required manifest headers
Here are the key elements of a feature definition, which is shown with a
representative example value:
Subsystem-SymbolicName: com.example.product.feature-1.0
The symbolic name of the feature, which follows the same
style and syntax as the Bundle-SymbolicName header for
bundles. Features can include other features, and when
they do, they use the symbolic name to reference each
other. The symbolic name of a feature should be
sufficiently unique that it is safe to assume that two
features with the same symbolic name are, in fact, the
same feature. This header also supports the usage of
attributes and directives, notably the visibility directive
that is described in 9.2.2, “Visibility constraints for
features, packages, and services” on page 196.
Subsystem-Content: com.example.product.bundle; version="[1,1.0.100)"
This header is the key to provisioning. It is a
comma-separated list of resources that defines the
feature’s content. As with package declarations in a
bundle manifest, each element of this list can specify
additional directives, such as type, location, or version.
These directives are described in more detail in 9.2.3,
“Subsystem content: Writing a minify-compatible feature”
on page 200.
Chapter 9. Developing and deploying custom features (new in Version 8.5.5) 195
IBM-App-ForceRestart: install,uninstall
The presence of this header in a feature manifest causes
applications to be restarted when this feature is either
installed, uninstalled, or both.
Public features
Public features should be considered product externals, or APIs. They can be
used directly in server.xml files, and are seen and used by the WebSphere
developer tools, and appear in messages. Public features should have an
IBM-ShortName header that is defined to simplify use. A list of public features that
is provided by the Liberty run time can be found in the following Information
Center article:
http://pic.dhe.ibm.com/infocenter/wasinfo/v8r5/topic/com.ibm.websphere.
wlp.core.doc/ae/rwlp_feat.html
Chapter 9. Developing and deploying custom features (new in Version 8.5.5) 197
Example 9-1 shows a snippet from a public feature manifest. Note the presence
of the IBM-ShortName header, which is used in combination with the extension
prefix in server.xml, and the public visibility constraint on the
Subsystem-SymbolicName header.
Protected features
Protected features are also product externals, but should be considered SPI, as
the target consumer for a protected feature is another feature. Although
protected features are not directly referenced in a configuration, they are
referenced by other extensions, and should be treated with an equal amount of
care when changes are made to avoid breaking consumers.
The Liberty profile defines several protected features, including features for the
application manager and the classloading service, for use by product extensions.
A list of protected features that are provided by the Liberty run time can be found
in the following Information Center article:
http://pic.dhe.ibm.com/infocenter/wasinfo/v8r5/topic/com.ibm.websphere.
wlp.core.doc/ae/rwlp_protected_features.html
Private features
Finally, we have the default: private features. Private features are usable only
within a product extension. Implementation details should be packaged using
private features. Auto features, which are described in 9.2.5, “Automatic
provisioning: Creating an auto-feature” on page 210, are almost always private
features, which rely on the provisioning of other public or protected features to
automatically enable additional capabilities.
Example 9-3 on page 199 shows a snippet from a private feature manifest.
Subsystem-SymbolicName: com.ibm.example.feature.private-1.0
Note: When enumerating API and SPI packages, the package version is not
respecified; the package versions should be maintained only by the bundles
that provide those packages.
Chapter 9. Developing and deploying custom features (new in Version 8.5.5) 199
9.2.3 Subsystem content: Writing a minify-compatible feature
The package utility, which is mentioned in 8.2, “Using the package utility” on
page 183, can produce a minified server image. When you package a server
with the --include=minify option, the package utility creates an archive that
contains resources that only the server configuration requires. The list of
required resources is built using the Subsystem-Content header that is defined
for each enabled feature. When you create your own feature, it is important to
verify the value of this header to ensure that a minified server that uses your
feature has all of the resources that it needs.
The Subsystem-Content header follows the syntax that shown in Example 9-4. As
with an Export-Package bundle header, it is a comma-separated list of values,
with optional semi-colon separated parameters, which can be attributes (=) or
directives (:=). Each item in the list identifies an individual resource using a
unique name.
Example 9-4 Syntax for Subsystem-Content header (see OSGi core spec section 1.3.2)
Subsystem-Content ::= resource ( ',' resource )*
The name that is used for a resource is influenced by its type, which is specified
as an optional attribute. By default, a resource is assumed to be an OSGi bundle
(type="osgi.bundle"). The bundle's symbolic name is used when specifying a
bundle resource. Likewise, a feature's symbolic name is used, along with
type="osgi.subsystem.feature", to include another feature as a resource. For
other supported types (type="file" and type="jar"), a unique string should be
created for the resource using the syntax and character set that is allowed for
symbolic or package names.
Chapter 9. Developing and deploying custom features (new in Version 8.5.5) 201
Creating an OSGi bundle project
Begin by creating a project for this bundle by completing the following steps:
1. Click File New OSGi Bundle Project.
2. Enter a project name. This example uses the project name
ITSO.OSGiExample.SimpleBundle.
3. For the Target Runtime, select WebSphere Application Server V8.5 Liberty
Profile.
4. Clear the Add bundle to application check box. If you leave this selected, a
new OSGi application project is created.
5. Leave all other values at the default settings and click Next Next.
6. This example uses a simple BundleActivator to show that the bundle is
loaded by the run time. Select the Generate an activator check box.
7. Exit the wizard by clicking Finish. The contents of the new bundle project
should resemble what is shown in Figure 9-2.
Chapter 9. Developing and deploying custom features (new in Version 8.5.5) 203
Creating a Liberty feature project
Begin by creating a project for the new feature by completing the following steps:
1. Click File New Other OSGi Liberty Feature Project, and then
click Next to open the Liberty Feature Project wizard, as shown in Figure 9-4.
5. Exit the wizard by clicking Finish. The contents of the new feature project
should resemble what is shown in Figure 9-6.
Chapter 9. Developing and deploying custom features (new in Version 8.5.5) 205
6. Double-click the Manifest element in the feature project to open the manifest
editor. Update the values in the manifest, as shown in Figure 9-7, and save
your changes. Specifically, update the feature’s symbolic name and the
feature name to include a version representation. This is counter to how
versions usually work; in this case, consider the version string in the feature
name to be a statement of API/SPI compatibility, especially for
public features.
7. To support making changes to the bundle version (to apply service), select
the bundle from the Subsystem-Content section of the editor, click
Properties, and edit the Minimum Version and Maximum Version fields, as
shown in Figure 9-8 on page 207, and click OK.
8. Click the SUBSYSTEM.MF tab at the bottom of the manifest editor to view the
raw source of the manifest, which should resemble what is shown in
Figure 9-9. The specified Subsystem-Content is minimal, as the feature
includes only a bundle resource (which is the default type), in a default
location, with the specified required version range.
Chapter 9. Developing and deploying custom features (new in Version 8.5.5) 207
Installing the feature
The WebSphere developer tools make installing the feature painless. Right-click
the feature project, select Install Feature... from the menu, select WebSphere
Application Server V8.5 Liberty Profile for the target run time, and click Finish.
The WebSphere developer tools adds the feature and its contents to the default
product extension of the target run time, as shown in Figure 9-10.
Figure 9-10 The example bundle and feature that is installed into the default product
extension
If you add this feature to a running server, you see something similar to the
output shown in Example 9-5. “Hello World!” is the output from the simple
activator that we provided for the feature bundle.
Chapter 9. Developing and deploying custom features (new in Version 8.5.5) 209
9.2.5 Automatic provisioning: Creating an auto-feature
An automatic feature is not configured by the user in the server XML. It is
automatically loaded by the feature manager if the features specified in its
IBM-Provision-Capability manifest header are configured by the user. This is
useful when two features require additional Java classes to work together. The
additional classes are put into the automatic feature. When only one of those
features is configured, the extra Java classes are not loaded. In this way,
automatic features can be used to keep features as small as possible without
requiring the user to understand any relationships between them.
For example, one feature might provide an application container and another
might provide a generic security service. In order for them to work together,
security collaborators specific to that container are required. Those collaborators
are not useful in the absence of either the container or the security service. In
this example, the security collaborator classes are packaged into a third,
automatic feature, which contains the entry that is shown in Example 9-6 in its
manifest file.
The bundles in the automatic feature can have mandatory dependencies on the
bundles in both of the other features because the feature is provisioned only
when both the container and security features are present. This is another way
that automatic features helps minimize the mandatory dependencies between
configured features.
Example 9-7 Definition of the native library name for Windows and OSX
Bundle-NativeCode:
lib/win32/x86/name.dll; osname=win32; processor=x86,
lib/macosx/libname.dylib; osname=macosx; processor=x86;
processor=x86_64
Java has some limitations when loading native libraries that also apply in an
OSGi framework. For example, a native library can be loaded only by one
classloader in a JVM process, so the same native library cannot be used by more
than one OSGi bundle.
Packaged server
If you want to create a complete deployment solution, you can generate an
archive by running the server package command. This outputs a compressed file
with the following contents:
The Liberty run time
Any features in the user product extension directory (wlp/usr/extension)
Chapter 9. Developing and deploying custom features (new in Version 8.5.5) 211
Your server configuration (for the server that is specified on the server
package command)
Any applications and resources that are contained within the server
Using the minify option generates a smaller package containing only the
features that are used by the server. This includes features that are configured in
the server.xml file, features that are included by configured features, and
features that are resolved as automatic features from the configured features.
For example, a minified server package for servlet support is only about 17 MB.
The function in a product extension can be fully integrated into the Liberty run
time and WebSphere developer tools. Because it uses the extensible Liberty
architecture, it also integrates into future tools that are written to use
that extensibility.
When you design product extensions, there are many aspects that you might
want to consider beyond simple function. These design principles are applied to
the Liberty product features to keep the servers highly composable and simple to
use. Those design principles are covered in the following sections.
By receiving your configuration from the server.xml file, you benefit from the
following capabilities:
Automatic parsing and injection of your configuration properties
Reinjection every time the property values are updated
Inclusion of your configuration in the generated schema that is used by the
WebSphere developer tools and any future graphical user interfaces
Management of configuration files by the Liberty run time
It also benefits your users by allowing them to keep all of their server
configurations in a single file or set of files.
Chapter 9. Developing and deploying custom features (new in Version 8.5.5) 213
Keeping it small and fast
Keep your dependency stack as short as possible. Defer as much of your
initialization processing as possible. For example, you can use OSGi Declarative
Services to delay loading of your service implementation classes until they
are used.
Dynamic behavior
Features should be able to stop and restart independent of the server restarting
and independent of each other. This relies on correct cleanup on shutdown and
the dynamic management of references to services in other features. Your
features should react dynamically to configuration updates. This dramatically
reduces the need for servers to be restarted, especially during application
development. It also greatly increases usability.
Simple migration
It should be painless for users to apply service and product upgrades. Some
design points that help to achieve that goal are included in the following list:
No migration is required for configuration; all configuration remains
compatible with earlier versions.
Longer toleration of Java versions.
Clear separation of product/user files and internal/external function.
Feature evolution is strictly compatible with earlier versions. The versions in
feature names provide a way to handle incompatibilities in upgrades by
providing a new feature version with the new behavior but continuing to
support the existing feature.
Select Additional materials and open the directory that corresponds with the
IBM Redbooks form number, SG248076.
Use the following process to use any of the three example projects,
ch3_ITSOWeb.zip, ch4_OSGiExample.zip, or ch5_ITSOWeb.zip:
1. Extract the compressed project file into its own subdirectory.
The resources that are listed in this section are considered suitable for a more
detailed description of the topics that are covered in this book.
Online resources
These websites are relevant as further information sources:
Enterprise Bundle Archive (EBA) Maven plug-in:
http://aries.apache.org/modules/ebamavenpluginproject.html
OSGi home page:
http://www.osgi.org
Stack Overflow tags:
http://stackoverflow.com/questions/tagged/websphere-liberty
Supported operating systems for the Liberty profile:
http://www-01.ibm.com/support/docview.wss?uid=swg27038218
Technologies that are supported by the Liberty profile:
http://pic.dhe.ibm.com/infocenter/wasinfo/v8r5/topic/com.ibm.websphe
re.wlp.nd.doc/ae/rwlp_prog_model_support.html
WASdev community:
http://wasdev.net/
WASdev forum:
http://www.ibm.com/developerworks/forums/forum.jspa?forumID=2666
WebSphere Application Server Developer Tools for Eclipse:
http://publib.boulder.ibm.com/infocenter/radhelp/v9/topic/com.ibm.ra
d.install.doc/topics/t_install_wdt.html
WebSphere Application Server Liberty Profile Information Center:
http://pic.dhe.ibm.com/infocenter/wasinfo/v8r5/topic/com.ibm.websphe
re.wlp.nd.doc/ae/twlp_inst.html
WebSphere Application
Server Liberty Profile
Guide for Developers ®