Consultor Eletrônico



Kbase 20024: How to Generate a Stack Dump From a SonicMQ Broker or Client
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   5/6/2003

SUMMARY:

This solution applies to SonicMQ versions 2000.x, 3.x, and 4.x. It
discusses how to generate a stack dump from a SonicMQ process.

This information should be provided to customers as needed to diagnose
SonicMQ broker or client hangs.

EXPLANATION:

Processes will sometimes hang with no error output, often when there
is no known way to reproduce the problem. In such situations, the
best thing to do is to generate a stack dump when the problem occurs,
and capture that information for analysis by SonicMQ personnel.

SOLUTION:

To generate a stack dump for any Java process running on UNIX or
Linux, the process must be started with java.exe rather than jre.exe.
For the SonicMQ broker, this is set with the SONICMQ_JRE parameter in
<SonicMQ install dir>/bin/setenv. Make sure this points to the 'java'
executable rather than to 'jre', editing it if necessary.
If you do change this setting, you must shutdown the broker and
restart it for the change to take effect.

You must then obtain the process id of the Java process running the
broker. Using the ps -ef command, you'll see a process listed for
the startbr.sh script, which starts the broker. Its pid is the
parent process id (ppid) for the Java process running the broker.
Using the pid of this Java process, you can generate the stack dump
with the following command issued from a terminal or window
other than the one from which the broker or server was started:

kill -QUIT <pid>

On UNIX the output goes to the console; on Linux it is directed to a
text file whose name is displayed on the console.

To generate a stack dump for any Java process running on any Windows
platform, as above, the process must be started with java.exe, and it
must be started from the command line. (A stack dump cannot be
generated from a process running as a Windows service.) Then you can
generate the stack dump by hitting CTRL-BRK on the keyboard.

SonicMQ versions 3.5 and above install, and for the broker, use the
'java' executable by default on Windows, so no modifications to the
installed bat file are necessary.

For SonicMQ 2000.x and 3.0.x, the 'jre' executable is installed on
Windows, and is used by the SonicMQ broker by default. This means that
to get a stack dump from a pre-3.5 SonicMQ broker running on Windows
NT or Windows 2000, the variables used in startbr.bat to start the
broker must be modified. To get a stack dump from an administrative
client (Explorer or the command line admin tool), the same thing must
be done for explorer.bat or admin.bat. The same also applies to
SonicMQ.bat if you wish to get a stack dump while running any of the
SonicMQ samples.

So, for SonicMQ 2000.x and 3.0.x, you must do the following:

1. Install a JRE for your platform which includes the java executable;
the one installed automatically on NT under the SonicMQ install
directory includes only jre.exe.

2. Modify the SONICMQ_JRE and JRE_CLASSPATH variables. The original
settings are:

set SONICMQ_JRE=<SonicMQ install path>\java\bin\jre.exe
set JRE_CLASSPATH=<SonicMQ install path>\java\lib\rt.jar

They should be changed to:

set SONICMQ_JRE=<New JRE install path>\bin\java.exe
set JRE_CLASSPATH=<New JRE install path>\lib\rt.jar

3. Make sure the DOS command prompt window screen buffer size is as
large as you can set it, to accommodate the full output of the
thread dump.

For all versions of SonicMQ, you can now use your .bat file to start
the offending process, and hit CTRL-BRK when you wish to generate a
stack dump. The stack dump will appear in the console window.

NOTE: In all of the above cases, the JRE's JIT compiler is enabled by
default. For ongoing problems, it is often helpful to disable the JIT
compiler so that the stack traces generated will include line numbers
indicating each thread's path through the internal SonicMQ code.

The JIT compiler is typically disabled by passing an argument to the
JRE when a process is started; the argument and syntax varies by JRE
vendor and version.


References to Written Documentation:

Knowledge Base Solution 20026:
How to generate Java stack trace?

Knowledge Base Solution 20027:
How to diagnose Java program problems?

Knowledge Base Solution 20030:
NoClassDefFoundError Starting SonicMQ Broker w/JRE 1.2.2

Knowledge Base Solution 20032:
SonicMQ: How To Use a JRE Other Than The Default On WinNT

SonicMQ Supported Third Party Products and Platforms:
http://www.sonicsoftware.com/products/platforms.htm

SonicMQ Online Release Notes, included in the product documentation,
and also available online at:
http://www.sonicsoftware.com/products/documentation/

SonicMQ 2000.x Installation and Administration Guide,
Chapter 1, Installation, "Platform Requirements"

SonicMQ 3.x Installation Configuration & Administration Guide,
Chapter 1, Installation, "Platform Requirements"