Introduction
If before you had to deal with the development of applications for WebSphere Application Server (hereinafter referred to as WAS), then you certainly know that this process is not fast. This required the deployment of its own “heavy” application server, one reboot of which took a long time. The WebSphere development team has been thinking about how to provide developers with the simplest, best, and most accessible environment for building new web applications for WAS. As a result, the new Liberty Profile version appeared in WAS 8.5, which greatly simplifies the process of developing applications for WAS.
So what is the Liberty Profile and what does it do?
In essence, the Liberty Profile is a dynamic WAS profile that allows a WAS server to provide only those functions that are required by an application (or several applications) deployed on this server. If the application needs servlets, then only the WAS kernel, HTTP transport and the web container are launched. All this happens very quickly (in a few seconds) and requires a very modest amount of resources. Do you need a JPA provider to access relational data? You do not have to search for a long time, just add the JPA option and the storage configuration and the Liberty Profile will include everything you need. All this is done in dynamic mode. Even though the server restarts in a few seconds, you do not have to do this. This is very important for development, as you constantly add new features to the application, change the code and correct errors. Developers need to make changes to the program code and configuration easy, and that these changes are immediately reflected in the test environment. It all becomes so simple with the Liberty Profile and the new
WAS Developer Tools .
Where can I download?
Download the Liberty Profile on the
WASdev website
- WebSphere Application Server V8.5.5 Liberty Profile . This site offers to install Liberty Profile in two ways:
- Using the Eclipse Marketplace Client. Drag the install button to the Eclipse panel and follow the further instructions.
- Using JAR archives.
This article will discuss the second method of installation.
')
Installation
Download the file wlp-developers-runtime-8.5.5.1.jar and run the command:
java -jar wlp-developers-runtime-8.5.5.1.jar
We accept the terms of the license agreement, and also indicate the directory into which the Liberty Profile is to be unarchived. In my case, this is the / Users / alex / Dev / WebSphere directory, and the wlp subdirectory will be automatically created in it. The wlp directory itself is our Liberty Profile. What next? You need to familiarize yourself with the basic commands that the server utility offers in the bin directory.
Server utility
* create - creates a new server
./bin/server create TestServer Server TestServer created.
* start - starts the server in the background
./bin/server start TestServer Starting server TestServer. Server TestServer started with process ID 56059.
* run - starts the server in console mode
./bin/server run TestServer Launching TestServer (WebSphere Application Server 8.5.5.1/wlp-1.0.4.cl50120131011-1639) on Java HotSpot(TM) 64-Bit Server VM, version 1.7.0_45-b18 (en_US) [AUDIT ] CWWKE0001I: The server TestServer has been launched. [AUDIT ] CWWKZ0058I: Monitoring dropins for applications. [AUDIT ] CWWKF0011I: The server TestServer is ready to run a smarter planet.
* stop - stops the running server
./bin/server stop TestServer Stopping server TestServer. Server TestServer stopped.
* status - checks if the specified server is running
./bin/server status TestServer Server TestServer is not running.
Server configuration
The server configuration is stored in the server.xml file, which, in turn, is located in the usr / servers / TestServer / directory. Let's look at its contents:
more usr/servers/TestServer/server.xml <server description="new server"> <!-- Enable features --> <featureManager> <feature>jsp-2.2</feature> </featureManager> <httpEndpoint id="defaultHttpEndpoint" host="localhost" httpPort="9080" httpsPort="9443" /> </server>
By default, the server uses TCP / IP port 9080 for HTTP traffic, as well as port 9081 for HTTPS traffic.
We start the server in any way convenient for you and go to the browser page
http: // localhost: 9080 / :

Installing applications using the dropins folder
If the application does not use any
specific settings , you can place it (as an archive or folder) in the dropins directory. A running server will automatically detect changes in static or dynamic resources, such as JSP, for example. To update, say, servlets, you must remove the application from the dropins folder, wait a bit and add an updated version.
Installing applications using server configuration
If the application uses any
specific settings , you need to place it in the apps directory and configure it in the server.xml file. To remove an application, delete its settings from the server.xml file. You can set up monitoring of changes in customized applications with automatic restart, if there have been changes.
Add support for Web Services, JMS and MongoDB
Download the file wlp-developers-extended-8.5.5.1.jar and run the command:
java -jar wlp-developers-extended-8.5.5.1.jar
We accept the terms of the license agreement, and also indicate the directory in which the Liberty Profile is installed.
Checking the performance of Liberty Profile
Download
Servlet Sample , unzip it to the Liberty Profile directory.
java -jar ServletSample.jar
We start the server and go to the browser page
http: // localhost: 9122 / ServletApp / :
/bin/server run ServletSample Launching ServletSample (WebSphere Application Server 8.5.5.1/wlp-1.0.4.cl50120131011-1639) on Java HotSpot(TM) 64-Bit Server VM, version 1.7.0_45-b18 (en_US) [AUDIT ] CWWKE0001I: The server ServletSample has been launched. [AUDIT ] CWWKZ0058I: Monitoring dropins for applications. [AUDIT ] CWWKT0016I: Web application available (default_host): http://localhost:9122/ServletApp/ [AUDIT ] CWWKZ0001I: Application ServletApp started in 0.220 seconds. [AUDIT ] CWWKF0011I: The server ServletSample is ready to run a smarter planet.

Other examples can be downloaded from the
Liberty Repository - Product Samples page.
useful links