Thursday, 16 January 2014

WebSphere Application Server - Liberty Profile - Oh, what fun

A recent comment on my blog reminded me that I'd not "played" with the Liberty profile in a while.

I installed it on my Mac a while back, so it was an easy task to find it and fire it up.

This is what I did ( from Terminal ): -

Navigate to the Liberty directory

$ cd ~/wlp

Navigate to the bin directory

$ cd bin

Get the version of Liberty installed

$ ./productInfo version

Product name: WebSphere Application Server
Product version: 8.5.0.2

Check the status of the defaultServer instance

$ ./server status

Server defaultServer is not running.

Start the defaultServer instance

$ ./server start

Server defaultServer started with process ID 11626.

Stop the defaultServer instance

$ ./server stop

Server defaultServer stopped.

I then deployed a web application ( SuperSnoop ) from this old-but-useful IBM Techdoc: -


This document is almost 10 years old, dating from September 2004, but the Snoop servlet contained therein is still useful.

I'd previously packaged the sample Javacode up into a WAR file - SuperSnoopWeb.war - so it was a simple matter to place the WAR file and then restart the Liberty server: -

$ cp ~/SuperSnoopWeb.war ~/wlp/usr/servers/defaultServer/dropins

and then start the defaultServer instance again: -

./server start

Server defaultServer started with process ID 11823.

and check the logs: -

$ cat ~/wlp/usr/servers/defaultServer/logs/console.log 

Launching defaultServer (wlp-1.0.2.cl0220130316-0213/websphere-kernel_1.0.2) on Java HotSpot(TM) 64-Bit Server VM, version 1.7.0_21-b12 (en_US)
[AUDIT   ] CWWKE0001I: The server defaultServer has been launched.
[AUDIT   ] CWWKZ0058I: Monitoring dropins for applications.
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://localhost:9080/Liberty1/*
[AUDIT   ] CWWKZ0001I: Application Liberty1 started in 0.72 seconds.
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://localhost:9080/SuperSnoopWeb/*
[AUDIT   ] CWWKZ0001I: Application SuperSnoopWeb started in 0.6 seconds.
[AUDIT   ] CWWKF0011I: The server defaultServer is ready to run a smarter planet.


and then test the SuperSnoop Servlet: -



Note that the dropins folder ( ~/wlp/usr/servers/defaultServer/dropins/ ) provides the mechanism for …. well, dropping WAR files in ( and out ) of the Liberty configuration without the need to actually deploy the WAR file ( which typically requires an edit of the server's configuration file ( ~/wlp/usr/servers/defaultServer/server.xml )

In other words, it's the lazy solution :-)

As ever, #LifeIsGood

What's next ?

I note that I'm still running Liberty 8.5.0.2, and strongly suspect that there's an updated version out there i.e. 8.5.5.1, so I'm off to the web to get a new wlp.jar file :-)

Here's some required reading for you: -




WebSphere Application Server V8.5.5 Liberty Profile - Test drive Liberty, the WAS profile designed for developers.

*UPDATE* 17 January 2014

Yep, and now I have 8.5.5.1 installed: -

$ ./wlp/bin/productInfo version

Product name: WebSphere Application Server
Product version: 8.5.5.1
Product edition: DEVELOPERS


 $ cat ./wlp/usr/servers/defaultServer/logs/console.log

Launching defaultServer (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_21-b12 (en_US)
[AUDIT   ] CWWKE0001I: The server defaultServer has been launched.
[AUDIT   ] CWWKZ0058I: Monitoring dropins for applications.
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://localhost:9080/SuperSnoopWeb/
[AUDIT   ] CWWKZ0001I: Application SuperSnoopWeb started in 0.215 seconds.
[AUDIT   ] CWWKF0011I: The server defaultServer is ready to run a smarter planet.
SuperSnoop running

 

2 comments:

Mikkel Flindt Heisterberg said...

Great post - it never struck me that I could run the Liberty Profile directory on my Mac. Saved me loads of time as I was contemplating setting up a VM with a full WAS. Much easier. Thanks!!!

P.S.: The link to the SuperSnoop is invalid I'm afraid.

JeremyHughes said...

There's a version here (it looks old and I haven't tried it): https://www-03.ibm.com/support/techdocs/atsmastr.nsf/WebIndex/PRS3417

We've started a new app along the same lines called Ferret, on the WASdev GitHub space. You can get it here: http://github.com/wasdev/sample.ferret