Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

What is "Liberty Profile" - IBM WebSphere Application Server V8.5

DZone's Guide to

What is "Liberty Profile" - IBM WebSphere Application Server V8.5

· Java Zone
Free Resource

Try Okta to add social login, MFA, and OpenID Connect support to your Java app in minutes. Create a free developer account today and never build auth again.

"Liberty Profile" - IBM WebSphere Application Server V8.5

IBM WebSphere Application Server V8.5 Liberty profile is a flexible and dynamic server profile of WAS which enables the WAS server to deploy only required custom features instead of deploying a big set of available JEE components.

What is Liberty profile in IBM WAS?

Liberty Profile is part of IBM WebSphere Application Server V8.5.5.5. It is very lightweight profile of WebSphere Application Server. Liberty profile is a flexible and dynamic profile of WAS which enables the WAS server to deploy only required custom features instead of deploying a big set of available JEE components. Developers can choose required features based on business requirement and push it to app server. WAS Liberty profile is best suited for developers working on mission critical enterprise applications. It could be even used for production deployment. Current version of IBM WAS Liberty profile is Java EE 6 complaint and works well for applications using this Java EE 6 certified web profile.

Liberty profile is also known as light weight, down sized version of WAS starting from 8.5. We can choose to use the same for application development if we have limited and well defined set of server components.

WAS Liberty profile Architecture

Architecture Component Description

  1. Liberty Kernel:  It is the core server profile component.
  2. Java EE 6+ :  Standard Java EE6 API
  3. Features: JSP, JSF, Web App Security, Servlet, JMS etc.
  4. Applications: Web applications, Enterprise applications
  5. OSGi Framework Runtime: In-built run time bundles

Note:

"Liberty profile is a part of IBM WAS Product and it is shipped as an in-built core feature of the WebSphere Application Server. Liberty profile is not at all a separate product. It is a runtime environment for application server (WAS) with a rich feature set that varies by WebSphere Application Server multiple editions.

How WAS Liberty Profile Works?

If web-application requires only a servlet engine, then rather than starting all other components liberty profile only starts the WAS kernel, the HTTP transport and the web container so that developers can quickly start and deploy the applications.

If an application needs persistence feature in their application and would like to use JPA Provider component to access relational data (RDBMS), developer just need to add JPA configuration in XML and Liberty profile will make it available persistence in the application.

The set of features which we will define in <featureManager> tag describes the concrete profile for the configured server specific instance and then those lists of features are tailored for the application deployed to the application server. Internally, these features are a discrete set of JARs which is nothing but the OSGi bundles which are initialized and started as soon as they are added to the server configuration file (e.g. server.xml ). <feature> tag is use to define app specific JEE features.

The Liberty profile works on a dynamic runtime environment known as OSGi runtime. OSGi services are used to manage JEE based component lifecycles, and the injection of dependencies and their runtime configuration. After this step server process and comprises a single JVM, known as the Liberty kernel, and any number of optional features required by the applications. After that configured feature code and most of the kernel code both runs as independent OSGi bundles or OSGi modules within an OSGi framework (Open System Gateway).

The Liberty profile supports a subset of the full WebSphere Application Server programming model. It supports below types-

  • Web applications
  • OSGi applications
  • Enterprise JavaBeans (EJB) applications

OSGi Framework Lifecycle

OSGi framework follows OSGi Lifecycle for their Bundles. Below is the typical lifecycle of OSGi.


How to Install WAS Liberty profile?

There are two ways to download and install the Liberty profile runtime

  1. From within your Eclipse IDE.
  2. As a standalone JAR file that you install from the command line.

Please refer below URLs for download

https://developer.ibm.com/wasdev/downloads/

http://marketplace.eclipse.org/content/ibm%C2%AE-websphere%C2%AE-application-server-v85-liberty-profile-developer-tools-eclipse-helios-indigo

Why should I use WAS Liberty Profile?

There are some key benefits of using Liberty profile runtime which is listed below:


WAS Liberty profile Simple configuration

Liberty profile makes it really easy to configure our server in a very simple and efficient way using XML file. For example, default server.xml configuration file may look like below:

<server description="test server">

  <!--Enable features which you would like to use -->

  <featureManager>

  <feature>jsp-2.2</feature>

  </featureManager>

  <httpEndpoint id="appHttpEndpoint" host="localhost" httpPort="9080" httpsPort="9443" />

</server>

As per above default server.xml configuration basically enables the JSP 2.2 feature, which depends on the Servlet 3.0 feature; hence the Servlet feature is automatically enabled. We need not to call and define it explicitly in WAS server.xml configuration file.

WAS Liberty profile configuration "Code Snippets"

Below are some code snippet to configure WAS Liberty Profile. We can use the same as and when required in the application development.

<server>

  <featureManager>

  <feature>servlet-3.0</feature>

  <feature>mylocalConnector-1.x</feature>

  </featureManager>

</server>

above code will enable servlet-3.0 API and myLocalConnector-1.x for the configured application in the IBM WebSphere Server.

<server description= "Dev Server DV 33-04">

  <featureManager>

  <feature>servlet-3.x</feature>

  </featureManager>

 <application id="TestWebApp" location="WebApps/Test.war" name="TestWebApp" type="war"

</server>

above code will enable servlet-3.0 API and a dependent WAR file named as Test.WAR under web application TestWebApp.

<server description="My Test server">

  <featureManager>

<!--enable jndi api for datasource lookups -->

  <feature>jndi-1.0</feature>

</featureManager>

</server>

above code will enable jndi-1.0 version for application.

<client>

  <featureManager>

  <feature>javaeeClient-7.x</feature>

  <featureManager>

 <application id="CLIENT_APP_ID_VALUE" name="CLIENT_APP_TYPE" type="ear" location="clientAppType.ear"/>

</client>

above code will enable java client api v7 and apply this to when deploy as an EAR file.

datasource configuration snippet

<?xml version="1.0" encoding="UTF-8"?>

<server description="My Test DB server">

  <!-- Enable features -->

  <featureManager>

  <feature>jdbc-4.x</feature>

  </featureManager>

  <datasource databaseName="${was.server.dir}/CustomerDB" id="datasource_id" jndiName="data/jndi/lookup/Bank/CustomerDB"

 </server>

above code will enable jdbc-4.0 API and enable configured database name based on jndi lookup.

Standard JEE specification in WAS Liberty profile

Below Oracle JEE/J2EE/JSR specifications are available in stable IBM WAS Liberty profile. Developers can configure any features using above code snippets based on application requirement.

  • CDI 1.2
  • JSP 2.3 and EL 3.0
  • Application client 1.0
  • JASPIC 1.1
  • JACC 1.5
  • SIP Servlets 1.1 and tools
  • SPNEGO support
  • OSGi App integration
  • JDBC 4.1
  • OSGi & Web 3.1 facet configuration for OSGi bundles
  • JAX-RS 2.0 client wizard
  • Support for remote development
  • Auto-scaling and dynamic routing
  • Real-Time Communications (WebRTC) and CouchDB
  • JAX-RS 2.0, Java Batch
  • JMS 2.0, JPA 2.1
  • Bean validation 1.1
  • JSON-P 1.0
  • EJB 3.2 Lite
  • Concurrent-1.0
  • Servlet 3.1
  • OpenID Connect
  • Java 8 toleration
  • WebSockets

Challenges 

1.  The Liberty Profile is free to use which is good but only in development environment not in production environment. If we want to move to production with the Liberty Profile we will anyways need to pay the usual IBM WAS licensing cost which does not sounds good.

2.  There are other Lightweight servers out there today in the market which is free even for Production environment so choosing Liberty profile over those options still need to be evaluated.

3.  The Liberty Profile does not provide any UI like administrative console to perform server specific useful configuration actions like updating the server config or installing/uninstalling applications etc. so we have to rely on Eclipse/RAD/NetBeans editor to update the server.xml file or we have to manually modify it which does not look a feasible option for developers.

4.  Application developers compare this server to Tomcat and Glassfish which have already been around for many years so it could be one of the biggest challenges for moving to liberty profile.

5.  In latest version liberty profile is coming up with lot of new features so it will be interesting to see how the Liberty Profile handles the increase functionality load with both footprint and size (approx. 60MB).

6.  For Lower IBM WebSphere Server versions (5, 6, 7) it is not compatible which could be a challenge for developers and applications using them.

Summary

In a nutshell we can say that Liberty Profile is one of the fastest changing and most interesting app servers to watch on the market today. So we should really focus on their upcoming releases. New Beta versions are coming up very quickly in the market with lot of new features which can use in our applications with just a simple configuration. IBM should really focus on building UI and some Migration Apps for Liberty Profile developers so that they can rapidly adopt it as compare to other major competitors like Tomcat, Glassfish, Joss etc. It will be really interesting to see how the latest versions of Liberty Profile handle the increase functionality with both footprint and size which is the major plus with IBM WAS Liberty Profile.

References

https://developer.ibm.com/wasdev/websphere-liberty/

https://developer.ibm.com/wasdev/

https://developer.ibm.com/wasdev/blog/2013/03/29/introducing_the_liberty_profile/

https://www-01.ibm.com/support/knowledgecenter/was_beta_liberty/com.ibm.websphere.wlp.nd.multiplatform.doc/ae/cwlp_arch.html
https://developer.ibm.com/wasdev/docs/developing-applications-wdt-liberty-

Build and launch faster with Okta’s user management API. Register today for the free forever developer edition!

Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}