Websphere Application Server Liberty Profile is a fast,light weight, easy to use and dynamic application server runtime environment. The server can be started and stopped very quickly and the configuration changes also can be done very easily. Installation is just unzipping the downloaded zip file and the product ships with one default instance. The command used to work with WLP (WebSphere Liberty Profile) is different than that of a full profile.
Below are some examples:-
1.) To lists the available servers.
root@molus-VirtualBox:/media/sf_Blog/wlp/bin# ./server list
The following servers are defined relative to the user directory /media/sf_Blog/wlp/usr.
defaultServer
root@molus-VirtualBox:/media/sf_Blog/wlp/bin#
root@molus-VirtualBox:/media/sf_Blog/wlp/bin# ./server list defaultServer
The following servers are defined relative to the user directory /media/sf_Blog/wlp/usr.
defaultServer
root@molus-VirtualBox:/media/sf_Blog/wlp/bin#
Note that, If server name is not mentioned command will be issued against default server.
2.) To create a new server.
root@molus-VirtualBox:/media/sf_Blog/wlp/bin# ./server create myserver
Server myserver created.
root@molus-VirtualBox:/media/sf_Blog/wlp/bin# ./server list
The following servers are defined relative to the user directory /media/sf_Blog/wlp/usr.
defaultServer
myserver
root@molus-VirtualBox:/media/sf_Blog/wlp/bin#
Here you can notice that the list has newly created server also.
3.) To know the status of the servers.
root@molus-VirtualBox:/media/sf_Blog/wlp/bin# ./server status
Server defaultServer is not running.
root@molus-VirtualBox:/media/sf_Blog/wlp/bin#
Since there is no server name mentioned the command will be issued against the default server and hence the command will not display the status of "myserver" which is newly created.
To know the status of specific server you have to mention the server name as input.
root@molus-VirtualBox:/media/sf_Blog/wlp/bin# ./server status myserver
Server myserver is not running.
root@molus-VirtualBox:/media/sf_Blog/wlp/bin#
4.) To start the server. (Background)
root@molus-VirtualBox:/media/sf_Blog/wlp/bin# ./server start defaultServer
Starting server defaultServer.
Server defaultServer started with process ID 19474.
root@molus-VirtualBox:/media/sf_Blog/wlp/bin#
If you list the process details, the process details will not be too lengthy like WebSphere Application Server full profile instances. Note down the line, The same line can be used instead of "server" command.I will show you the demo in the later part of this post.
root@molus-VirtualBox:/media/sf_Blog/wlp/bin# ps -ef |grep java
root 19474 1 51 23:19 pts/0 00:00:25 java -javaagent:/media/sf_Blog/wlp/bin/tools/ws-javaagent.jar -Djava.awt.headless=true -jar /media/sf_Blog/wlp/bin/tools/ws-server.jar defaultServer
root@molus-VirtualBox:/media/sf_Blog/wlp/bin#
5.) To Stop the started server
root@molus-VirtualBox:/media/sf_Blog/wlp/bin# ./server stop
Stopping server defaultServer.
Server defaultServer stopped.
root@molus-VirtualBox:/media/sf_Blog/wlp/bin#
Since server name is not mentioned the command will consider only default server. If specific server needs to be stopped severname should be provided as input to the command.
6) To run the server in foreground.
root@molus-VirtualBox:/media/sf_Blog/wlp/bin# ./server run defaultServer
Launching defaultServer (WebSphere Application Server 19.0.0.1/wlp-1.0.24.cl190120190124-2339) on OpenJDK Server VM, version 10.0.1+10-Ubuntu-3ubuntu1 (en_IN)
[AUDIT ] CWWKE0001I: The server defaultServer has been launched.
[AUDIT ] CWWKE0100I: This product is licensed for development, and limited production use. The full license terms can be viewed here:
https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/license/base_ilan/ilan/19.0.0.1/lafiles/en.html
[AUDIT ] CWWKZ0058I: Monitoring dropins for applications.
[AUDIT ] CWPKI0820A: The default keystore has been created using the 'keystore_password' environment variable.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.aries.jndi.startup.Activator (file:/media/sf_Blog/wlp/lib/com.ibm.ws.org.apache.aries.jndi.core_1.1.24.jar) to field
javax.naming.spi.NamingManager.initctx_factory_builder
WARNING: Please consider reporting this to the maintainers of org.apache.aries.jndi.startup.Activator
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[AUDIT ] CWWKF0012I: The server installed the following features: [jsp-2.3, jsonb-1.0, ejbLite-3.2, managedBeans-1.0, beanValidation-2.0, servlet-4.0, jsf-2.3, ssl-1.0, jndi-1.0, cdi-2.0, jdbc-4.2,
appSecurity-3.0, jsonp-1.1, appSecurity-2.0, jaxrsClient-2.1, el-3.0, jaxrs-2.1, jpaContainer-2.2, webProfile-8.0, jaspic-1.1, distributedMap-1.0, jpa-2.2, websocket-1.1].
[AUDIT ] CWWKF0011I: The server defaultServer is ready to run a smarter planet.
Note that you will not get a command prompt back as you are starting the server in foreground. You will be able to see the runtime logs here.
As explained earlier you can use the below command to run the server in foreground. (I have exited the previous runtime before issuing the below command)
root@molus-VirtualBox:/media/sf_Blog/wlp/bin# java -javaagent:/media/sf_Blog/wlp/bin/tools/ws-javaagent.jar -Djava.awt.headless=true -jar /media/sf_Blog/wlp/bin/tools/ws-server.jar defaultServer
Launching defaultServer (WebSphere Application Server 19.0.0.1/wlp-1.0.24.cl190120190124-2339) on OpenJDK Server VM, version 10.0.1+10-Ubuntu-3ubuntu1 (en_IN)
[AUDIT ] CWWKE0001I: The server defaultServer has been launched.
[AUDIT ] CWWKE0100I: This product is licensed for development, and limited production use. The full license terms can be viewed here:
https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/license/base_ilan/ilan/19.0.0.1/lafiles/en.html
[AUDIT ] CWWKZ0058I: Monitoring dropins for applications.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.aries.jndi.startup.Activator (file:/media/sf_Blog/wlp/lib/com.ibm.ws.org.apache.aries.jndi.core_1.1.24.jar) to field
javax.naming.spi.NamingManager.initctx_factory_builder
WARNING: Please consider reporting this to the maintainers of org.apache.aries.jndi.startup.Activator
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[AUDIT ] CWWKF0012I: The server installed the following features: [jsp-2.3, jsonb-1.0, ejbLite-3.2, managedBeans-1.0, beanValidation-2.0, servlet-4.0, jsf-2.3, ssl-1.0, jndi-1.0, cdi-2.0, jdbc-4.2,
appSecurity-3.0, jsonp-1.1, appSecurity-2.0, jaxrsClient-2.1, el-3.0, jaxrs-2.1, jpaContainer-2.2, webProfile-8.0, jaspic-1.1, distributedMap-1.0, jpa-2.2, websocket-1.1].
[AUDIT ] CWWKF0011I: The server defaultServer is ready to run a smarter planet.
7.) To know the version of the environment.
root@molus-VirtualBox:/media/sf_Blog/wlp/bin# ./server version
WebSphere Application Server 19.0.0.1 (1.0.24.cl190120190124-2339) on OpenJDK Server VM, version 10.0.1+10-Ubuntu-3ubuntu1 (en_IN)
root@molus-VirtualBox:/media/sf_Blog/wlp/bin#
8.) To display the command help.
root@molus-VirtualBox:/media/sf_Blog/wlp/bin# ./server help
Usage: ./server {create|debug|dump|help|javadump|list|package|pause|resume|run|start|status|stop|version} serverName [options]
serverName
A locally unique name for the server; the name can be constructed
using Unicode alphanumeric characters (for example, A-Za-z0-9), the
underscore (_), dash (-), plus (+) and period (.). A server name
cannot begin with a dash (-) or period (.).
Actions:
Server Lifecycle
create
Create a new server if the specified server does not exist. The
--template option can be used to specify a template to use when
creating a new server.
debug
Run the named server in the console foreground after a debugger
connects to the debug port (default: 7777).
run
Run the named server in the console foreground.
start
Start the named server.
status
Check the status of the named server.
stop
Stop the running instance of the named server.
Problem Determination
dump
Dump diagnostic information from the server into an archive. The
--archive option can be used. The --include option can be used with
the "heap", "system" and "thread" values.
javadump
Dump diagnostic information from the server JVM. The --include
option can be used with the "heap" and "system" values.
Information
help
Print help information.
list
List the Liberty profile application servers that are defined.
version
Show server version information and exit.
Miscellaneous
package
Package a server to an archive. The --archive option can be used.
The --include option can be used with values "all", "usr", "minify",
"wlp", "runnable", "all,runnable", and "minify,runnable". The values
"runnable" and "all,runnable" are equivalent. The "runnable" value
works with "jar" type archives only. The --server-root option can be
used to specify the root folder in the package archive.
pause
Pause all the components in the server that can be paused. You can
pause a subset of the components by specifying the components on the
--target option.
resume
Resume all paused components in the server. You can specify the
--target option to resume specific paused components.
Options:
Use help [actionName] for detailed option information of each action.
root@molus-VirtualBox:/media/sf_Blog/wlp/bin#
Amazing blog post, thank for share your experience.
ReplyDeleteBulk PDF Signer