When I choose a tool for any kind of job, there are around three questions I usually consider:

  1. Is this going to be able to do the job?
  2. Is this the easiest way to do it?
  3. Do I like using it?

For many years now we’ve provided a functionally rich set of application development tools for WebSphere Application Server, with deeply integrated support for testing and debugging on WAS. Fidelity between the test and production environments is assured through having a full edition of WAS as the test environment (a server type, in Eclipse terms) integrated in Rational Application Developer. This passes the test posed by question #1 with flying colors.

In the WebSphere and Rational teams, we’ve been thinking about question #2 for a while and have been working towards providing the simplest, best and most easily accessible environment for developers to create new web applications for WAS.

WAS V8.5 introduces the new WAS “Liberty” Profile, which we think answers all three questions with a resounding Yes!

So what is the WAS Liberty profile and how does it do this?

At its heart, the Liberty profile is a dynamic profile of WAS that enables the WAS server to provision only the features required by the application (or set of applications) deployed to the server. If an application requires just a servlet engine, then all that starts is the WAS kernel, the HTTP transport and the web container. Which is lightening fast to bring up (a few seconds) and has an incredibly small
footprint. Need a JPA provider to access relational data? No need to go hunting around to find one, just add in the JPA feature and persistence configuration and we’ll switch that on. Dynamically. Even though the server only takes you a few seconds to restart, you don’t have to. Which is important in a development environment, as you build up the capabilities of an application, modify classes, add resources and fix problems. Developers need code and configuration changes to be easy to make and reflected immediately in the test environment. This is as easy as it gets with the combination of the WAS Liberty Profile and the new WAS Developer Tools.

WAS Developer Tools

Something developers have been asking about for a while now is availability of the most common RAD tools as a standalone feature that can
be added to Eclipse. This is exactly what the WAS Developer Tools for Eclipse (WDT) are intended to be – and available for free – with a focus on Java EE web and mobile tools and integration of the WAS
Liberty profile for the debug/test server environment. Developers can now develop, assemble, test and publish web applications using lightweight tools to a lightweight runtime which has fidelity to the full WAS profile. And, starting with WAS V8.5, we’re adding Mac as a development environment on which the WAS Liberty profile can run.

Development Simplicity

Lets go back to my question #2: “is this the easiest way to do the job?”. The lightweight tools and runtime are important for iterative compile-edit-debug, so we’re off to a good start. Fidelity of the unit/functional test environment with the production server environment simplifies continuous integration into pre-production and production systems. But while you’re still in the development environment, you want the simplest way possible to configure that test server – for example to define resources the application may need, such as datasources.

Beyond its focus on minimizing footprint and startup time, the WAS Liberty profile provides a new and development-centric approach to configuring the server. Configuration is through a simple XML file which is easy to author, maintain in a version control system, share across and between development team, and diff for changes. Ultimately, we have made the server configuration for the WAS Liberty profile a development artifact. The most basic configuration for a Liberty profile server with a simple web app deployed looks like this:

server.xml configuration

server.xml configuration

The set of features in <featureManager> listed describes the concrete profile for the configured server instance and is tailored for the application(s) deployed to the server. Internally, features are a discrete set of JARs (actually OSGi bundles) that are initialized as soon as they are added to the configuration. In this case the BasicWeb app requires only the servlet-3.0 feature so this is all the Liberty kernel will start. This is the same servlet container that runs on the full WAS profile, just without everything else. Liberty profile configurations are dynamic and are monitored by the runtime, so if features or applications are updated the runtime dynamically reacts to these changes without requiring a server restart.

Applications typically use resources that require some configuration so lets look at a datasource configuration snippet:

datasource configuration snippet

The “jdbc-4.0” and elements can be added straight into the server.xml above for the simplest configuration. More complex applications may be developed by teams who divide ownership and maintainence of different parts of the application and different parts of the configuration. Flexible configuration is supported through a logical composite spanning multiple configuration files related through includes. So the above datasource configuration snippet can be maintained separately from the main server.xml and simply included by it:

Flexible configuration

Flexible configuration

Installing the WAS Liberty Profile and WDT couldn’t be easier – just go to Downloads. Here you can download the WAS Liberty Profile on its own – It only takes a few seconds.

Or, from this page, you can learn how add WDT as an Eclipse feature to your Eclipse environment and use WDT to install the WAS Liberty Profile server type for debug and test. WDT and the WAS Liberty profile provide the easiest way to develop web applications for WebSphere. Going back to the last of my three questions…do I like using it? I do – but we’d like to know what you think.

Give it a try, and use the WASdev community to let us know what you think.

9 comments on"Introducing the Liberty Profile"

  1. I have a Liberty profile and the build is done using maven for the web apps that I have configured. How can I use the dynamic capability of not restarting server for JSP , Java code changes at the same time use maven file path ?
    another option I am also fine with is if I can also use both capability having a maven build as well as Add app through Add /Remove for dynamic hot code replacement capability ?


  2. How do you make the WLP not restart the server when you make changes to a java class? I tried on my desktop with a simple app, I changed the java class, and saved it, and then I see the server restarted. See this:
    Launching MyTestServer (WebSphere Application Server on IBM J9 VM, version jvmwi3260sr7-20100219_54049 (en_US)
    [AUDIT ] CWWKE0001I: The server MyTestServer has been launched.
    [AUDIT ] CWWKZ0058I: Monitoring dropins for applications.
    [AUDIT ] CWWKT0016I: Web application available (default_host): http://localhost:9080/springsecurity/
    [AUDIT ] CWWKZ0001I: Application springsecurity started in 1.527 seconds.
    [AUDIT ] CWWKF0011I: The server MyTestServer is ready to run a smarter planet.
    [AUDIT ] CWWKT0017I: Web application removed (default_host): http://localhost:9080/springsecurity/
    [AUDIT ] CWWKZ0009I: The application springsecurity has stopped successfully.
    [AUDIT ] CWWKT0016I: Web application available (default_host): http://localhost:9080/springsecurity/
    [AUDIT ] CWWKZ0003I: The application springsecurity updated in 0.871 seconds.

    The server.xml is like this:


    • Hi Ron,

      Looking at the log you posted the server is not restarting – it is the application “springsecurity” that is restarting (the difference between a server and an app restart is other applications deployed to a server are not restarted when an app restarts). This is the default behavior in the runtime – to change it you can open the server.xml and change the application update trigger setting from mbean (or polled) to “disabled” – this will stop the application being restarted unless you manually restart the server (there are a few different options on the behavior, this one disabling automatic updates). More information can be found by clicking on “applicationMonitor” on the following knowledgecenter page: http://www-01.ibm.com/support/knowledgecenter/SSAW57_8.5.5/com.ibm.websphere.wlp.nd.doc/autodita/rwlp_metatype_4ic.html?cp=SSAW57_8.5.5%2F1-3-11-0-3-0&lang=en

      • Tom, thanks for the reply and yes the web app restarted by the server. Actually I got the right solution. We do need to have the app pick up whatever changes right away through the mbean (we can not disable it). It works. Thanks again.

  3. Anyone know if the following is possible? My Java based application has a lot of security roles defined in the web.xml. Every time I deploy a new version of the application to WebSphere, I have to map tons of application defined roles to the LDAP groups via the WebSphere “role to user group” functionality. Is there a way for me to define the mapping itself in the application, so when I deploy the war in WebSphere, it picks up on what the map pings are?


  4. FranciscoRiveros February 04, 2014

    Very good initiative but I tested and I have one problem I don’t know if you can help me. I have always developed in Tomcat integrated with STS, so I have downloaded and integrated the WAS liberty Server with STS, and I cannot execute my application since appears Context Root Not Found and in the Console appears:
    [WARNING ] jsf.warn.ri.listener.for.myfaces.app
    [WARNING ] SRVE0274W: Error while adding servlet mapping for path–>/spring/*, wrapper–>ServletWrapper[Spring MVC Dispatcher Servlet:[/spring/*]], application–>MyWebapp
    [WARNING ] SRVE0274W: Error while adding servlet mapping for path–>/messadmin, wrapper–>ServletWrapper[MessAdminServlet:[/messadmin]], application–>MyWebapp[WARNING ] SRVE0274W: Error while adding servlet mapping for path–>/IsLogout, wrapper–>ServletWrapper[com.logoutlistener.IsLogout:[/IsLogout]], application–>MyWebapp[WARNING ] jsf.warn.ri.listener.for.myfaces.app

    My Web App is an Spring Webflow with JSF with Mojarra and Primefaces application.


    • Hi,

      Can I just check something?

      Have you got a web.xml with servlet mappings in it pointing to the correct location/classes?

      Let me know how it goes and I’ll investigate further if necessary. 🙂

      • I’m having the same issue with this. My servlet mapping in web.xml is

        Faces Servlet

        Faces Servlet

        and the context root in the ear application.xml is /home

Join The Discussion

Your email address will not be published. Required fields are marked *