|
Problem(Abstract) |
When an IBM® WebSphere® Application Server Java™ process
crashes on a UNIX® system, it should produce a memory dump in a file named
"core". Unfortunately, a subsequent crash will overwrite an existing core
file. This document explains a technique for preserving an existing core
file as part of the startup sequence for the WebSphere Application Server
on UNIX systems. |
|
|
|
Resolving the
problem |
An abnormal termination (crash) of the WebSphere
Application Server process on a UNIX system will normally produce a memory
dump file named "core", in the $WAS_HOME/bin directory. It is important to
save this file for problem determination and diagnosis purposes.
This document discusses a technique which can be used to save these core
files by modifying the Application Server start script (startServer.sh).
This is important because a core file could potentially be overwritten.
- Create a directory into which the core files should be copied (e.g.,
$WAS_HOME/core.files)
- Change directory to the $WAS_HOME/bin directory (this is the directory
containing startServer.sh)
- Make a backup copy of startServer.sh
- Edit startServer.sh
- Locate an appropriate place to insert the following instructions
(e.g., on the line following the ". $binDir/setupCmdLine.sh"
statement)
- Insert the following instructions:
#-----------------------------------------------------------------
# The following uses relative directory addressing to specify the
# destination directory into which the core files will be copied.
#-----------------------------------------------------------------
# Note: These steps are part of startServer.sh, which will be
# executed when the current directory is <WAS_HOME>/bin.
# Therefore, the actual directory being referenced is
# <WAS_HOME>/core.files/
# Also, this code is written assuming that ksh is the
# default shell interpreter.
#-----------------------------------------------------------------
CORE_HOME="../core.files/"
#-----------------------------------------------------------------
# If a "core" file exists, move and rename it.
# Note: The process of moving, and renaming the core file does not
# change the creation/modification time associated with the
# file. This information can be used to determine when the
# abnormal termination of the WebSphere Application Server
# process actually occurred.
#-----------------------------------------------------------------
if [ -e core ]; then
CORE_FILE=$CORE_HOME"WSAS.core."$(date "+%y-%m-%d.%H:%M:%S")
echo "Saving core as $CORE_FILE"
mv core $CORE_FILE
fi
When WebSphere Application Server is started using this script at a
command prompt, the existing core file in the $WAS_HOME/bin directory will
be renamed WSAS.core.<timestamp> and moved into $WAS_HOME/core.files
directory.
Note that this is only effective if the server is started using a script
which executes this code (such as startServer.sh, as suggested above), and
not when a deployment manager instructs a node agent to start a server
process. |
|
|
|
|
Cross Reference information |
Segment |
Product |
Component |
Platform |
Version |
Edition |
Application Servers |
Runtimes for Java Technology |
Java SDK |
|
|
|
|
|
|