server dump command
The server dump
command creates a snapshot of a server and saves the result into an archive file for further tuning and diagnosis.
This command is useful for problem diagnosis of an Open Liberty server because the resulting file contains server configuration, log information, and details of the deployed applications in the work area directory. The command can be applied to either a running or a stopped server.
For a running server, the following information is also included:
State of each OSGi bundle in the server
Wiring information for each OSGi bundle in the server
Component list that is managed by the Service Component Runtime (SCR) environment
Detailed information of each component from SCR
Configuration administration data of each OSGi bundle
Information about registered OSGi services
Runtime environment settings such as Java virtual machine (JVM), heap size, operating system, thread information, and network status
The resulting file is created by using UTF-8 encoding for entry names, so the tool that you use to open the file must be able to use UTF-8 encoding for entry names. The jar
command in a Java SDK uses this format.
Usage examples
Create a dump file of thread information from the myserver
server in a ZIP archive called myserver.zip
:
server dump myserver --archive="myserver.zip" --include=thread
Create a snapshot of the myserver
server status in a ZIP archive called myserver.zip
:
server dump myserver --archive=myserver.zip --include=heap
Syntax
Run the command from the path_to_liberty/wlp/bin
directory.
server dump serverName [options]
- serverName
The name of the server to run the command against. If you do not specify a server name, the command uses
defaultServer
for the name value. If no existing server in thewlp/usr/servers
directory is nameddefaultServer
, the command fails when no server name is specified.
Options
Option | Description |
---|---|
--archive=path_to_the_target_archive_file | Specifies a target file for the |
--include=diagnose_option,diagnose_option,… | Specifies the type of diagnostic information to be captured. The value of
The thread dump type is supported only when the server is running on the Java SDK. If the server is started with a JRE, an error is reported indicating that the server does not support the dump type. This restriction applies to HotSpot virtual machines only; the thread Java dump type is supported on any IBM JVM (JRE or SDK). |
Exit codes
The following exit codes are available for the server dump
command and the equivalent executable JAR file ws-server.jar
:
Code | Explanation |
---|---|
0 | This code indicates successful completion of the requested operation. |
1 | This code indicates invocation of a redundant operation. For example, starting a started server or stopping a stopped server. This code might also be returned by JVM if invalid Java options are used. |
4 | This code indicates that an unsupported action was called on a stopped server. For example, the server is not running when the dump action is called. |
>=20 | Exit codes that are greater than or equal to 20 indicate that an error occurred while performing the request. Messages are printed and captured in log files with more information about the error. |