From Development to Production with the IBM WebSphere Application Server Liberty Profile

IBM Redbooks Solution Guide

Abstract

IBM® WebSphere® Application Server is the leading software foundation for service-oriented architecture (SOA) applications and services for your enterprise. With IBM WebSphere Application Server, you can build business-critical enterprise applications and solutions, and combine them with innovative new functions. The WebSphere Application Server family includes and supports a range of products that helps you develop and serve your business applications. You can use these products to build, deploy, and manage dynamic websites and other more complex solutions productively and effectively.

Beginning with WebSphere Application Server V8.5, two profiles of the runtime application server are delivered. The full profile is the traditional run time that supports a broad range of programming models and features that are designed to provide workload management, availability, scalability, performance, and security. The Liberty profile is a lightweight application serving run time with many of the same features that are available in the full profile, but it is designed for more streamlined operations. WebSphere Application Server V8.5.5 further enhances the capabilities in the Liberty profile to add programming support, for example, web services and messaging support, and to add runtime features that are designed to enhance security, availability, and more.

This IBM Redbooks® Solution Guide provides insight into the usage of the Liberty profile for development, testing, and production environments.

For related information about this topic, refer to the following IBM Redbooks publication:
WebSphere Application Server V8.5 Concepts, Planning, and Design Guide, SG24-8022-01

Contents


IBM® WebSphere® Application Server is the runtime implementation of IBM of the Java Platform, Enterprise Edition (Java EE) platform. WebSphere Application Server is available in unique packages that meet a wide range of customer requirements. Each package has its own unique characteristics, but at the heart of all of them is the same runtime application server environment.

The run time that is traditionally available with the WebSphere Application Server is referred to as the full profile. The full profile provides support for Java Platform Enterprise Edition 6 (Java EE 6) and Enterprise OSGi technologies. The application serving run time that is provided by this profile is composed of a wide spectrum of components that are always available in the application server.

Starting with WebSphere Application Server V8.5, a Liberty profile is included with each edition. The Liberty profile provides a simplified and lightweight application-serving environment while still providing enterprise qualities of service, including security and transaction integrity. The Liberty profile is intended for use as a development or production environment for running web applications that do not require a full Java EE stack. The Liberty profile is included with each WebSphere Application Server edition except for the Community Edition. In addition, a new Liberty Core package is available with Version 8.5.5.

This IBM Redbooks® Solution Guide introduces the WebSphere Application Server V8.5.5 Liberty profile solution for both development and production use. Figure 1 gives an overview of the Liberty profile and its tools.

Figure 1. WebSphere Application Server Liberty profile and tools
Figure 1. WebSphere Application Server Liberty profile and tools


Did you know?

WebSphere Application Server V8.5.5 provides significant enhancements to the functionality that is included in the Liberty profile. These enhancements include additional programming support to complete the Java EE 6 web profile support, Java Messaging Support (JMS) (including a new integrated messaging server and support for WebSphere MQ), web services support for both service provider and client, server clustering for availability and scalability, and more.


Business value

The WebSphere Application Server Liberty profile provides a lightweight, simple, yet powerful application server for web applications. The Liberty run time supports the web profile of the Java EE 6 specification, providing a standards-based application programming model. The Liberty profile and the WebSphere Application Server Developer Tools for Eclipse are freely available for developer desktops and supported under WebSphere Application Server production runtime licenses.

For developers, the Liberty profile and the supporting developer tools can be downloaded quickly and used at no additional charge. The application server is simple to configure and quick to start. Configuration files can be shared to easily make an array of server configurations available to the development team, reducing the time that is spent on server administration. Developers can develop and test applications to run on a Liberty profile production server or to be ported to the full profile of WebSphere Application Server.

In production, the Liberty profile provides a secure and resilient runtime environment. Application servers are configured with only the features that are needed to run the application, providing an efficient and streamlined run time. Application servers can be clustered for scalability and availability, and can be managed collectively.

The Liberty profile run time can be extended with custom features. This capability is of interest to developers and administrators that want to include additional features and to IBM Business Partners that want to extend the Liberty profile server to provide a run time for their own products. The Liberty profile includes a utility that enables the server, server configuration, and applications to be packaged together for easy distribution.


Solution overview

The Liberty profile provides a simplified run time for web applications, supporting a subset of the programming model that is available with the full profile. It is a good option for developers who are building web applications that do not require the full Java EE environment of traditional enterprise application server profiles. Any application that runs on the Liberty profile will also run on the full profile.

The application-serving environment is configured with the correct level of capabilities that are required for the individual applications. You can use the Liberty profile to specify only those features that are required for the applications that are deployed, reducing the memory footprint and increasing performance. The Liberty profile has a simplified installation and uses an easy-to-configure XML configuration file format.

The Liberty profile is optimized for use in both development and production environments. Within the development environment, the Liberty profile development environment is supported on the same platforms as the base application server plus the Mac OS X operating system and Ubuntu. Enterprise qualities of service, such as security and transaction integrity, are enabled as required. Developers deploy applications to a single server for testing. In production, servers can be managed from a common management domain and clustered for high availability and scalability.

The Liberty Profile supports direct enhancement of the run time through user-defined features that are deployed in product extensions. Creating your own features allows you to customize or extend the behavior of the run time by using system programming interfaces (SPIs) that applications do not have access to. User-defined features can also provide additional application programming interfaces (APIs) and services to deployed applications.

Because a Liberty profile server is lightweight, it can be packaged easily with applications in a compressed file. This package can be stored, distributed to colleagues, and used to deploy the application to a different location or to another system. It can even be embedded in the product distribution. The package contains all of the binary files, server configuration, and applications that are necessary to distribute the server.


Solution architecture

The Liberty profile is designed to meet the specifications of the Jave EE 6 web profile while also providing the same reliable containers and quality of service (QoS) attributes of the full profile of WebSphere Application Server.

Runtime architecture and configuration

The Liberty profile is built on OSGi technologies. The Liberty profile run time is composed of the Liberty profile kernel and any number of optional features that run inside of a single Java virtual machine process. The features that are present in the run time are specific to the function that is needed for that server instance and its applications. The kernel provides configuration, feature management, and logging services. Most of the kernel runs as OSGi bundles within an OSGi framework. Figure 2 shows the architecture of the Liberty profile. In this diagram, the server configuration includes just a few of the many features that are available.

Figure 2. Liberty profile architecture
Figure 2. Liberty profile architecture

The Liberty profile server environment operates from a set of built-in configuration defaults. A Liberty profile server configuration consists of a server.xml file, an optional bootstrap.properties file, and any files that are included by these two main configuration files. The server.xml file is the primary configuration file for the server and contains information about the features to be included in the runtime environment, the applications that are deployed into that runtime environment, their data sources, and optional properties, such as an override to a configuration default or a trace specification. The server.xml file can point to (include) one or more remote XML files to allow common configuration settings to be reused in multiple configuration files and to be shared across multiple servers.

Administrators and developers can use the Liberty profile developer tools or a text editor to edit the configuration files. Management of the environment can be done with simple commands, Jython scripts, or by using the developer tools. In addition to these methods of administration, the standard tools for Java run times, such as jConsole, can be used to monitor the Liberty profile runtime characteristics and to start select operations.

Figure 3 shows how Liberty servers can be configured and managed.

Figure 3. Server configuration and management
Figure 3. Server configuration and management

Managing multiple servers from a common point

Liberty servers can be managed individually or can be part of a common management domain that is called a Liberty collective. Liberty servers join the collective by registering with an operational registry and adding the collectiveMember feature to their configuration. A Liberty server that is configured as the collective controller provides full lifecycle management to all members in the collective, including product installation and maintenance, and operational access to all servers in the collective, without requiring an agent. Operational management includes commands, for example, to start and stop servers, and to perform file transfer in support of configuration changes and application installation. All WebSphere Application Servers editions can be members of a collective, but only Network Deployment or WebSphere Application Server for z/OS® can be the collective controller.

Clustering servers for high availability and scalability

Liberty servers that are members of a collective can be configured into a server cluster for resiliency and scalability. The cluster can be treated as a single object in the collective, simplifying the operational management of the servers in the cluster. The members of the cluster can be configured individually, or can share a configuration. A web server plug-in is used to distribute work across the servers in the cluster.

Figure 4 shows an example of clustering Liberty servers.

Figure 4. Clustering Liberty servers
Figure 4. Clustering Liberty servers

Expanding the run time with custom features

The Liberty profile run time can be enhanced through the inclusion of product extensions. OSGi bundles in a user-defined feature that can augment or extend supported programming models. For example, a custom trusted association interceptor (TAI) can be provided by a user-defined feature.

User-defined features in these extensions become an integrated part of the run time:

  • Services that are provided by a user-defined feature can receive a user-specified configuration from the server configuration file.
  • OSGi bundles in a user-defined feature can interact with OSGi services that are provided by the run time and by other extensions.
  • OSGi services that are provided by user-defined features can be shared with OSGi applications.
  • Classes in OSGi bundles that are provisioned by a user-defined feature can use system programming interfaces that are provided by the Liberty profile or by other extensions.

Developing and deploying applications

IBM Rational® Application Developer provides a feature-rich development solution for teams that develop software for WebSphere Application Server. Rational Application Developer Standard Edition provides developers with the ability to have a single environment to help simplify and accelerate the core tasks of designing and writing code, testing WebSphere applications, and then maintaining those applications. Rational Application Developer stays synchronized with WebSphere Application Server in terms of strategic focus on technologies and standards, including Java Platform, Enterprise Edition (Java EE) levels, SOA, Web and Web 2.0, Portal, and the OSGi programming model.

As an alternative to Rational Application Developer for developers that do not need the full range of features it offers, WebSphere Application Server Developer Tools for Eclipse V8.5.5 is available for developing applications that are targeted at a WebSphere Application Server full profile and Liberty profile as a run time. WebSphere Application Server Developer Tools for Eclipse contains the tools that are required for the development of Java EE applications (beyond what is in Eclipse), OSGi applications, and applications using the web and mobile programming models. It includes support for deploying applications to existing WebSphere Application Server V7, V8, and V8.5 installations and the V8.5 Liberty profile.

WebSphere Application Server Developer Tools for Eclipse is available at no additional charge for developer desktops. When you install the software from the Eclipse Marketplace, you typically pick WebSphere Application Server Developer Tools for Eclipse for the WebSphere Application Server version that you are using, which filters out support for the other versions. After you have installed the tools, you can see and install additional features, for example, support for a different version of WebSphere Application Server.

Developers can deploy applications to a Liberty profile server in several ways. Each of these methods is simple to use and quickly installs and starts the application.
  • The developer can deploy the application to a server by using the developer tools.
  • The developer can drop the application archive file (WAR, EAR, or EBA) or extracted archive into a drop-ins directory.
  • The application can be declared in the server.xml file, allowing you to explicitly configure attributes for the application.

Whether you deploy the application in the drop-ins directory or at a location that is defined in the server.xml file, these locations can be monitored for dynamic updates. When an application is placed in the directory, the server automatically deploys and starts the application. When an application is removed from the directory, it is removed from the server. When the application is updated, the updates are automatically made to the application on the server.

Enhancements have been made to Rational Application Developer V9.0 and WebSphere Application Server Developer Tools for Eclipse V8.5.5 in support of the new Version 8.5.5 capabilities.

Programming models

The Liberty profile supports a subset of the Java EE 6 stack. The following list notes the technologies that are supported by all versions of the Liberty profile:
  • Java Servlet 3.0
  • JavaServer Faces (JSF) 2.0
  • JavaServer Pages (JSP) 2.2
  • Java Expression Language 2.2
  • Standard Tag Library for JavaServer Pages (JSTL) 1.2
  • Bean Validation 1.0
  • Java Persistence API (JPA) 2.0
  • Java Transaction API (JTA) 1.1
  • Java Database Connectivity (JDBC) 4.0
  • Java API for RESTful Web Services (JAX-RS) 1.1

The WebSphere Application Server Liberty Core edition is a separate offering that is available for production usage that is based on the Liberty profile. The Liberty Core edition extends the technologies that are listed above to support the Java EE 6 Web Profile specification:
  • Contexts and Dependency Injection for Java (Web Beans 1.0)
  • Dependency Injection for Java 1.0
  • Enterprise JavaBeans 3.1 (includes Interceptors 1.1) - EJB Lite subset

In other editions, such as WebSphere Application Server and WebSphere Application Server Network Deployment, the Liberty profile supports the following technologies in addition to those that are contained in Liberty Core:
  • Java API for XML-Based Web Services (JAX-WS) 2.2
  • Java Architecture for XML Binding (JAXB) 2.2
  • SOAP with Attachments API for Java (SAAJ) 1.3
  • Java Message Service API (JMS) 1.1
  • Enterprise JavaBeans 3.1 - Message-Driven beans

The Liberty profile supports OSGi applications in all editions. The following list shows the supported technologies for OSGi applications:
  • Web Application Bundles
  • Blueprint Container
    • Blueprint Transactions
    • Blueprint Managed JPA
  • JNDI
  • OSGi application of Java EE technologies that are supported by the profile


Usage scenarios

The Liberty profile is suitable for use in any environment where web application developers can benefit from the use of a lightweight and agile development and test environment. It is also suitable for production environments, providing fast startup, a small footprint, clustering and failover capabilities, and simple administration. The following scenarios illustrate two common usage cases for the Liberty profile.

Scenario: Liberty for developers

In this scenario, a developer needs to develop and test an application that eventually will be deployed to production on the Liberty profile that is shipped with WebSphere Application Server Network Deployment. The application is a web-based application that allows users to check for the availability of an item in the company's inventory.

The developer has decided to use WebSphere Application Server Developer Tools for Eclipse (referred to in this document as the developer tools) as the development platform. The developer tools provide a development environment that is suited for the requirements of the application and the developer's needs. The programming models that are required for the application are supported by the developer tools, and the tools provide an easy-to-use interface for creating and managing the test servers.

The Liberty profile is used as the test environment because the production environment is also a Liberty environment. If the production environment is migrated to the full profile at a later date, the application can run, unchanged, in the full profile environment.

Installing the developer tools and Liberty profile

To get started, the developer uses the instructions on the WASdev.net website at http://www.ibm.com/developerworks/community/blogs/wasdev/entry/home to install the developer tools.

The developer then uses the developer tools to create a test server. Because the Liberty profile run time has not been installed, the tools provide the option to download and install the Liberty profile as part of the server creation process. The server is created with a default configuration and is listed in the Servers view of the developers tools (shown in the lower portion of Figure 5). The server can be started normally or in debug mode, and or can be stopped from this view. The developer can adjust the settings or add features to the server by double-clicking the server in the Servers view, which opens the server.xml file for edit (shown in the upper portion of Figure 5).

Figure 5. Server configuration open in the developer tools
Figure 5. Server configuration opened in the developer tools

Developing and testing the web service

The developer tools provide intuitive tools and aids, including wizards, that assist with the creation of the application. Figure 6 shows the developer tools with the source of the Inventory application open.

Figure 6. Developer tools
Figure 6. Developer tools

To test the application, it is deployed to the test server. The developer selects the server in the Servers view, right-clicks, and selects the Add and Remove option. The results of the deployment are shown in the developer tools Console view (Figure 7). After the application is deployed, updates that are made to the application in the developer tools are automatically deployed to the running server.

Figure 7. Application deploys to the server
Figure 7. Application deploys to the server

Some technologies are not automatically enabled in the developer tools but can easily be enabled by updating the facets properties for the project. Any time a new facet is enabled or an application is updated or deployed, the tools try to determine the corresponding server features that are required and prompt the user so that they can add the feature.

Packaging the server and application for deployment to production

The final step of the development and test process is to package the application for deployment to a production server or cluster. This can be accomplished by using the developer tools or a command that is shipped with the Liberty profile. In this scenario, the developer simply stops the server from the developer tools Server view, and uses the Package Server utility, which is available by right-clicking the server. The utility gives the option of including the server content (including the server binary files) along with the applications and configuration. In this case, the developer is passing a package to an administrator who deploys the application on a production system so that only the applications and configuration are included.

Scenario: Liberty for production

The administrator for the production system has received the applications from the developers, which are packaged for deployment. The administrator builds a production environment that consists of a cluster of several Liberty servers that are spread across multiple systems. Using a cluster provides scalability and availability features that are required for a production application environment. The administrator can start, stop, or check the status of the servers in the cluster as a single entity.

To use the cluster capabilities, the administrator builds a collective that consists of two Liberty servers that act as a replica set of collective controllers and four Liberty servers to act as collective members. Then, the collective members are configured as part of a cluster. The time that is required for this is only a few minutes. Two simple commands create and configure a server as a collective controller or member. A server becomes a part of a cluster with the addition of the <clusterMember-1.0> feature and naming the same cluster name in a <clusterMember> element. Servers can be dynamically added to and removed from the cluster by simply updating their configuration. In this scenario, the configuration for the application is stored in a common location and that file is pointed to with an <include> element in each server configuration file, thus deploying the application to the cluster.

The administrator generates a web server plug-in that is used by the web server to route requests among the cluster members. When the web server receives requests for the application, the plug-in routes the requests to the servers in a round-robin manner.


Integration

The Liberty profile can take advantage of integration with products that both enhance its ability to provide the quality of service required in production environments, and extend its reach to other systems and databases.

IBM WebSphere eXtreme Scale and the IBM WebSphere DataPower Appliance XC10 V2

IBM WebSphere eXtreme Scale provides an extensible framework to simplify the caching of data that is used by an application. You can use WebSphere eXtreme Scale to build a highly scalable, fault-tolerant data grid with nearly unlimited horizontal scaling capabilities. WebSphere eXtreme Scale creates an infrastructure that can deal with extreme levels of data processing and performance. When the data and resulting transactions experience incremental or exponential growth, the business performance does not suffer because the grid is easily extended by adding additional capacity in the form of JVMs and hardware. The IBM WebSphere DataPower® Appliance XC10 V2 is a hardware adaptation of a subset of the features of WebSphere eXtreme Scale. This appliance is a purpose-built and easy-to-use appliance that is used in the caching tier of the enterprise application infrastructure.

The Liberty profile can interoperate a data grid in WebSphere eXtreme Scale or the XC10 appliance in two ways. The Liberty profile can persist HTTP session data to the grid for session failover and high availability purposes, rather than to a database. Liberty also supports caching for dynamic web content. By default, this caching is performed with a local caching service. For scalability or to cache other data, Liberty can interoperate with WebSphere eXtreme Scale or the WebSphere DataPower XC10 V2 Appliance.

For more information about WebSphere eXtreme Scale, see: http://www-01.ibm.com/software/webservers/appserv/extremescale/.
For more information about the WebSphere DataPower Appliance XC10 V2, see: http://www.ibm.com/software/webservers/appserv/xc10/.

IBM Tivoli Directory Server

IBM Tivoli® Directory Server provides a high-performance LDAP identity infrastructure that can handle millions of entries. It is built to serve as the identity data foundation for web applications and identity management initiatives. The Liberty profile server can use the IBM Tivoli Directory Server as a single user registry option, or (new in Version 8.5.5) as part of federated LDAP registries for authentication and role-based authorization. For more information about the IBM Tivoli Directory Server, see http://www.ibm.com/software/products/us/en/directory-server/.

IBM WebSphere MQ

IBM WebSphere MQ is an asynchronous messaging technology for application-to-application communication that offers a fast, robust, and scalable messaging solution. WebSphere MQ ensures one time only delivery of messages to queue destinations that are hosted by queue managers. The Liberty profile supports asynchronous messaging that is based on the Java Message Service (JMS) programming interface using a JMS provider that conforms to the JMS specification V1.1 and includes a WebSphere MQ client for access to WebSphere MQ for production messaging.

Databases

The Liberty profile supports the Java Database Connectivity (JDBC) 4.0 specification to access databases. The Liberty profile supports connections to IBM DB2®, Apache Derby, IBM Informix® database, Microsoft SQL Server Enterprise Edition, Oracle Database, and Sybase Adaptive Server Enterprise.

The Liberty profile that is shipped with the base, Express, Network Deployment, and IBM z/OS editions support MongoDB to provide access to a scalable and document-oriented NoSQL database. Applications can get a reference to the database by using injection, JNDI lookup, or J2SE style. After the reference is obtained, access to the database is through the MongoDB Java API.

MongoDB support is not available in Liberty Core.


Supported platforms

WebSphere Application Server is supported on IBM AIX®, HP-UX, IBM i, Linux, Solaris, Windows, and z/OS. Complete information about the supported platforms and hardware can be found at http://www.ibm.com/software/products/us/en/appserv-was/.


Ordering information

This product is only available through IBM Passport Advantage®. Ordering information can be found in the software announcement for WebSphere Application Server V8.5.5 at http://ibm.co/13tRFV2.


Related information

For more information, see the following documents:
  • IBM Offering Information page (to search on announcement letters, sales manuals, or both):
    http://www.ibm.com/common/ssi/index.wss?request_locale=en
    On this page, enter WebSphere Application Server V8.5.5, select the information type, and then click Search. On the next page, narrow your search results by geography and language.

Special Notices

This material has not been submitted to any formal IBM test and is published AS IS. It has not been the subject of rigorous review. IBM assumes no responsibility for its accuracy or completeness. The use of this information or the implementation of any of these techniques is a client responsibility and depends upon the client's ability to evaluate and integrate them into the client's operational environment.

Profile

Publish Date
10 June 2013


Rating:
(based on 1 review)


Author(s)

IBM Form Number
TIPS1024