Comment lines: Nine things that make the Liberty profile so fast, easy, and smart to use

While focusing on development users, the IBM® WebSphere® Application Server Liberty profile maintains fidelity with the full-profile WebSphere Application Server; both profiles use the same containers and offer the same Quality of Service. Applications can be developed and tested using the Liberty profile and then deployed on full-profile WebSphere Application Server with no changes. Liberty is a highly composable and dynamic runtime that improves and enhances the out-of-the-box user experience for WebSphere Application Server developers. This article lists some of top features that make the Liberty profile smart to use This content is part of the IBM WebSphere Developer Technical Journal.

Share:

Sonali Samantaray (sonali.samantaray@in.ibm.com), Senior Staff Software Engineer, IBM

Sonali Samantaray works as a Senior Staff Software Engineer for IBM Software Labs, India for the WebSphere group. Along with a Master in Computer Applications degree, Sonali is an IBM Certified DB2 Associate and IBM Certified SOA Associate. She has authored various technical documents for the product and for various symposiums. She received the title of IBM developerWorks Contributing Author in 2010.



08 May 2013

Also available in Chinese Russian

Introduction

The Liberty profile, introduced with IBM® WebSphere® Application Server V8.5, is a faster, dynamic profile with a smaller footprint, aimed at increasing developer productivity and providing a higher operational efficiency.

Among its features, the Liberty profile offers a very simple way of configuring the server. OSGi services are used to manage component lifecycles, the injection of dependencies, and configuration. The server process is made up of a single JVM, the Liberty kernel, plus optional features you can select to include. It has:

  • An incredibly fast startup time (under 5 seconds for simple web applications).
  • Java™ EE and OSGi application deployment support for web applications and LDAP registry support.
  • Managed, centralized deployment of a packaged application and server.
  • IBM WebSphere Application Server Developer Tools available as Eclipse plug-ins for broad tooling support.

There is a lot of information out there that describes the reasons for and the benefits of using the Liberty profile for WebSphere Application Server development. But the handful of items listed here are 9 things that are particularly important to know about the Liberty profile, and can help you understand why it is such a time saver, and how it can really help streamline your development.

1. Server configuration by exception

The run time environment operates from a set of built-in configuration default settings, and you only need to specify configuration elements that override those default settings. You do this by editing either the server.xml file or another XML file that is included in the server.xml at run time. This approach provides many usability and operational benefits. Among them:

  • It is shareable across an application development team.
  • It is dynamically responsive to updates in the runtime.
  • It is easily editable in a text editor.

When you first install and start the server, a feature manager and a default server configuration are available. By default, a server contains the jsp-2.2 feature to support servlet and JSP applications. You can use the feature manager to add the additional features that you need.

2. File-based feature management

Liberty profile features include the programming models and services that are required by applications. Including a feature in the configuration can cause one or more additional features to be loaded automatically. For example, if you include servlet-3.0 in the server.xml configuration file, it gets loaded automatically. The available features are represented by .mf files, located under the lib/features directory of the server root location. The file name matches the feature name; for example, the servlet-3.0 feature is defined in a file called servlet-3.0.mf.

3. Easy administration

There is no administrative console for the Liberty profile. You can use IBM WebSphere Application Server Developer Tools for Eclipse or a text editor to edit the configuration files. A server configuration consists of a server.xml file, a bootstrap.properties file, and any optional files that are included by the two main configuration files. Some of the common administrative operations that can be performed include:

  • Start or stop the server

    The wlp/bin directory contains a script called server to help with controlling the server process. The syntax of this script is:

    server <task> [server] [options]

    For example:

    server start <server_name>

  • Use includes in configuration files

    The Liberty profile offers the flexibility of keeping your entire configuration in a single server.xml file, or you can use include elements to consolidate configurations from separate files to create a more simplified structure. Below is the syntax for including a configuration file; you can set the optional attribute as true if you want to skip the include file when it cannot be found:

    <include optional="true" location="pathname/filename"/>

    or

    <include optional="true" location="url"/>

  • Connect to the Liberty profile using JMX

    There are two JMX connectors supported on the Liberty profile. Each connector is enabled through a different Liberty feature: localConnector-1.0 and restConnector-1.0. The local connector is enabled through the Liberty feature localConnector-1.0. Access through the local connector is protected by the policy implemented by the SDK in use. Currently, the SDKs require that the client runs on the same host as the Liberty profile, and under the same user ID. The REST connector is enabled through the Liberty feature restConnector-1.0. Remote access through the REST connector is protected by a single administrator role. In addition, SSL is required to keep the communication confidential. The restConnector-1.0 feature already includes the ssl-1.0 feature.

  • Support web applications

    The Liberty profile provides support to the web applications using Liberty features such as servlet-3.0, jsp-2.2, and other features. To configure the server to load servlets when a web application is installed, add this line to the server.xml configuration file (or to a file that it includes):

    <webContainer deferServletLoad="false"/>

    This setting applies to all web applications installed in the server.

4. Developer Tools for Eclipse

WebSphere Application Server Developer Tools for Eclipse is a lightweight set of tools for developing, assembling, and deploying Java EE, OSGi, Web 2.0, and mobile applications to WebSphere Application Server. When combined with the WebSphere Application Server V8.5 Liberty profile, WebSphere Application Server Developer Tools for Eclipse provides a fast and lightweight environment for the rapid development and testing of Web 2.0, mobile, and OSGi applications. Using this you can create a Liberty profile server, administer it using the developer tools, edit the Liberty profile server configuration, explore the run time environment, publish your applications faster, generate a Liberty profile server dump, add and run an application on the Liberty profile, and more.

5. The productInfo command

The productInfo command supports validating the product integrity, comparing different versions of Liberty profile servers, and verifying the current product versions:

productInfo task [options] where [ options] compare | featureInfo | validate | version | help.

6. Drop-in application deployment

You can deploy an application onto a Liberty profile by either dropping the application into a previously defined dropins directory, or by adding an application entry to the server configuration.

By default, the dropins directory is automatically monitored. If you drop an application into this directory, the application is automatically deployed on the server. Similarly, if the application is deleted from the directory, the application is automatically removed from the server.

The dropins directory can be used for applications that do not require additional configuration, such as security role mapping. You do not have to include the application entry or any relevant information in the server configuration. For applications that are not in the dropins directory, you specify the location using an application entry in the server configuration. The location can be on the file system or at a URL.

7. Security quick start

You can use the quickStartSecurity element to quickly enable a simple (one user) security setup for the Liberty profile. For this you have to include the appSecurity-1.0 feature in the server.xml file. Define the user name and password that is to be granted the Administrator role for server management activities:

<quickStartSecurity userName="admin" userPassword="adminpwd" />

You can then configure the deployment descriptor with the relevant security constraints to protect the web resource. For example, use <auth-constraint> and <role-name> elements to define a role that can access the web resource and then configure your application in the server.xml file.

8. The securityUtility command

The securityUtility command supports plain text encryption and SSL certificate creation for the Liberty profile. The tasks available for the securityUtility command are:

  • encode: Encodes the provided text using Base64 encryption. If no arguments are specified, the command enters interactive mode. Otherwise, the provided text is encoded. Text with spaces must be put in quotation marks if specified as an argument.
  • createSSLCertificate: Creates a default SSL certificate for use in server configuration. Generated keystore file key.js is placed under the /resources/security directory of the server specified in --server name. The key algorithm is RSA and the signature algorithm is SHA1 with RSA. For more control over the certificate creation, use keytool directly.

    The arguments are:

    --server=name --password=passwd --validity=days --subject=DN

9. Tracing and logging

Tracing and logging provides base implementations of trace and FFDC services — for runtime code and for your own code — to gather debug information. You can set logging properties in the server configuration file by selecting Logging and Tracing in the Server Configuration view in the developer tools, or by adding a logging element to the server configuration file as such:

<logging traceSpecification="*=audit=enabled:com.myco.mypackage.*=debug=enabled"/>


Conclusion

The Liberty profile in IBM WebSphere Application Server V8.5 and later is targeted to the developer community. Some of the most important and useful features were described in this article, and more still can be found in Resources below. If you haven't started using the Liberty profile yet, it's never too late to start working faster and more efficient.

Resources

Learn

Get products and technologies

Comments

developerWorks: Sign in

Required fields are indicated with an asterisk (*).


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name



The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


All information submitted is secure.

Dig deeper into WebSphere on developerWorks


static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=WebSphere
ArticleID=877428
ArticleTitle=Comment lines: Nine things that make the Liberty profile so fast, easy, and smart to use
publish-date=05082013