Sun Gathering Debug Data for Sun Java System Application Server

2.3 Running the Application Server Debugging Scripts

This section describes the appserver_8_hang.sh and pkg_app scripts.

2.3.1 Running the appserver_8_hang.sh Debugging Script

The goal of the appserver_8_hang.sh script is to automate the collection of debug data if the Application Server gets into an unresponsive state when running on a Solaris system.

ProcedureTo Run the appserver_8_hang.sh Script

All data generated by the script is compiled under a single tar.gz file named APPSERVD_DATA_ddmmyyhhmmss.tar.gz, where ddmmyyhhmmss is the date and timestamp.

In addition to general debug data, this script gathers data three times on the specific instance (prstat -L -p, pflags, pstack, pmap, pldd, pfiles), separated by the time specified in the variable INTERVAL (see below).

  1. The following variables must be defined before running the script:

    DAS_OR_INSTANCE

    Either domain name, if gathering DAS instance information, or instance name, if gathering non-DAS instance information

    DAT_DIR

    Output directory where temporary and final data will be stored

    HOSTNAME

    Host name/IP of the interface on which the HTTP requests will be made when using the INTERVAL variable (see below)

    DAS_OR_INSTANCE_HTTP_PORT

    HTTP port on which the HTTP requests will be made (see below)

  2. Optionally, you can set the following at run time:

    INTERVAL

    Determines the interval between loops (see above); defaults to 10 seconds

    JAVA_5

    If the app server is running Java 5, choose “yes” to have the script run additional Java 5–specific commands (jps, jinfo, jmap, jstack)

    JAVA_HOME

    Required if JAVA_5=yes

    GCORE

    Determines whether a gcore of the Application Server process will be taken (GCORE="yes") or not (any other value); running the pkg_app.sh script on the generated core file is required if this variable is enabled

    JAVA_THREADS

    Determines whether kill -3 will be run on the Application Server process (to obtain Java thread dump)

    TRUSS

    Determines whether the Application Server process will be trussed for TRUSS_DURATION; defaults to 30 seconds

    HTTP_10_REQ

    Determines whether an HTTP 1.0 request will be made on the Application Server's HTTP interface (DAS_OR_INSTANCE_HTTP_PORT)

    HTTP_11_REQ

    Determines whether an HTTP 1.1 request will be made on the Application Server's HTTP interface (DAS_OR_INSTANCE_HTTP_PORT)

    HTTP_URI

    The URI used when running the HTTP requests (see above)

2.3.2 Running the pkg_app Script

This script packages an executable and all of its shared libraries into one compressed tar file, and named corresponding to the PID of the application and optionally the name of the core file to be opened. The files are stripped of their directory paths and are stored under a relative directory named app/ with their name only, allowing them to be unpacked in one directory.

ProcedureTo Run the pkg_app Script

On Solaris 9 OS or later, if the core file is specified, the list of files is derived from the core file rather than from the process image. You still must provide the PID of the running application to assist in path resolution.

Two scripts are created to facilitate opening the core file when the tar file is unpacked:


Note –

The pkg_app script asks for your Sun Case Number to name the tar.gz file.


  1. Copy the script to a temporary directory on the system where Application Server is installed.

  2. Become superuser.

  3. Execute the pkg_app script in one of the following three ways:

    • ./pkg_app application-pid corefile

    • ./pkg_app application-pid(The pkg_app scripts prompts for the corefile name.)

    • ./pkg_app core file