PQ89393: Message-driven beans fail to handle Runtime Exceptions properly

 Fixes are available

5.1.1.17: WebSphere Application Server V5.1.1 Cumulative Fix 17 for AIX
5.1.1.17: WebSphere Application Server V5.1.1 Cumulative Fix 17 for HP-UX
5.1.1.19: WebSphere Application Server V5.1.1 Cumulative Fix 19 for Linux
5.1.1.16: WebSphere Application Server V5.1.1 Cumulative Fix 16 for AIX
5.1.1.18: WebSphere Application Server V5.1.1 Cumulative Fix 18 for AIX
5.1.1.18: WebSphere Application Server V5.1.1 Cumulative Fix 18 for HP-UX
5.1.1.18: WebSphere Application Server V5.1.1 Cumulative Fix 18 for Solaris
5.1.1.18: WebSphere Application Server V5.1.1 Cumulative Fix 18 for Windows
PQ89393; 5.0.2.3: Message-driven beans fail to handle Runtime Exceptions properl
5.1.1.18: WebSphere Application Server V5.1.1 Cumulative Fix 18 for Linux
5.1.1.17: WebSphere Application Server V5.1.1 Cumulative Fix 17 for Linux
5.1.1.17: WebSphere Application Server V5.1.1 Cumulative Fix 17 for Solaris
5.1.1.17: WebSphere Application Server V5.1.1 Cumulative Fix 17 for Windows
5.0.2.7: WebSphere Application Server Express 5.0.2 Cumulative Fix 7
5.1.0.5: WebSphere Application Server V5.1.0 Cumulative Fix 5
5.0.2.17: WebSphere Application Server 5.0.2 Cumulative Fix 17 for Solaris
5.0.2.17: WebSphere Application Server 5.0.2 Cumulative Fix 17 for Windows
5.0.2.14: WebSphere Application Server 5.0.2 Cumulative Fix 14 for Solaris
5.1.1.10: WebSphere Application Server V5.1.1 Cumulative Fix 10 for Windows
5.1.1.10: WebSphere Application Server V5.1.1 Cumulative Fix 10 for AIX
5.0.2.14: WebSphere Application Server 5.0.2 Cumulative Fix 14 for Linux
5.1.1.19: WebSphere Application Server V5.1.1 Cumulative Fix 19 for AIX
5.1.1.19: WebSphere Application Server V5.1.1 Cumulative Fix 19 for Windows
5.1.1.9: WebSphere Application Server V5.1.1 Cumulative Fix 9 for Solaris
5.0.2.15: WebSphere Application Server 5.0.2 Cumulative Fix 15 for Windows
5.0.2.15: WebSphere Application Server 5.0.2 Cumulative Fix 15 for Solaris
5.0.2.15: WebSphere Application Server 5.0.2 Cumulative Fix 15 for AIX
5.1.1.9: WebSphere Application Server V5.1.1 Cumulative Fix 9 for AIX
5.0.2.15: WebSphere Application Server 5.0.2 Cumulative Fix 15 for Linux
5.0.2.12: WebSphere Application Server 5.0.2 Cumulative Fix 12
5.0.2.14: WebSphere Application Server 5.0.2 Cumulative Fix 14 for HP-UX
5.0.2.14: WebSphere Application Server 5.0.2 Cumulative Fix 14 for AIX
5.1.1.9: WebSphere Application Server V5.1.1 Cumulative Fix 9 for Windows
5.0.2.17: WebSphere Application Server 5.0.2 Cumulative Fix 17 for HP-UX
5.0.2.17: WebSphere Application Server 5.0.2 Cumulative Fix 17 for AIX
5.1.1.11: WebSphere Application Server V5.1.1 Cumulative Fix 11 for AIX
5.0.2.17: WebSphere Application Server 5.0.2 Cumulative Fix 17 for Linux
5.1.1.10: WebSphere Application Server V5.1.1 Cumulative Fix 10 for HP-UX
5.1.1.10: WebSphere Application Server V5.1.1 Cumulative Fix 10 for Linux
5.1.1.9: WebSphere Application Server V5.1.1 Cumulative Fix 9 for HP-UX
5.1.1.9: WebSphere Application Server V5.1.1 Cumulative Fix 9 for Linux
5.0.2.16: WebSphere Application Server 5.0.2 Cumulative Fix 16 for HP-UX
5.1.1.12: WebSphere Application Server V5.1.1 Cumulative Fix 12 for Windows
5.0.2.16: WebSphere Application Server 5.0.2 Cumulative Fix 16 for Solaris
5.0.2.8: WebSphere Application Server V5.0.2 Cumulative Fix 8
5.0.2.16: WebSphere Application Server 5.0.2 Cumulative Fix 16 for Windows
5.0.2.16: WebSphere Application Server 5.0.2 Cumulative Fix 16 for AIX
5.1.1.11: WebSphere Application Server V5.1.1 Cumulative Fix 11 for Windows
5.1.1.16: WebSphere Application Server V5.1.1 Cumulative Fix 16 for Solaris
5.0.2.18: WebSphere Application Server 5.0.2 Cumulative Fix 18 for Solaris
5.1.1.11: WebSphere Application Server V5.1.1 Cumulative Fix 11 for Linux
5.0.2.18: WebSphere Application Server 5.0.2 Cumulative Fix 18 for Windows
5.0.2.18: WebSphere Application Server 5.0.2 Cumulative Fix 18 for HP-UX
5.0.2.18: WebSphere Application Server 5.0.2 Cumulative Fix 18 for AIX
5.1.1.16: WebSphere Application Server V5.1.1 Cumulative Fix 16 for Windows
5.1.1.14: WebSphere Application Server V5.1.1 Cumulative Fix 14 for Solaris
5.0.2.14: WebSphere Application Server 5.0.2 Cumulative Fix 14 for Windows
5.1.1.12: WebSphere Application Server V5.1.1 Cumulative Fix 12 for AIX
5.1.1.12: WebSphere Application Server V5.1.1 Cumulative Fix 12 for Linux
5.1.1.12: WebSphere Application Server V5.1.1 Cumulative Fix 12 for HP-UX
5.1.1.12: WebSphere Application Server V5.1.1 Cumulative Fix 12 for Solaris
5.1.1.11: WebSphere Application Server V5.1.1 Cumulative Fix 11 for Solaris
5.1.1.13: WebSphere Application Server V5.1.1 Cumulative Fix 13 for AIX
5.1.1.13: WebSphere Application Server V5.1.1 Cumulative Fix 13 for Windows
5.0.2.13: WebSphere Application Server 5.0.2 Cumulative Fix 13
5.1.1.13: WebSphere Application Server V5.1.1 Cumulative Fix 13 for HP-UX
5.1.1.15: WebSphere Application Server V5.1.1 Cumulative Fix 15 for Solaris
5.1.1.13: WebSphere Application Server V5.1.1 Cumulative Fix 13 for Solaris
5.1.1.13: WebSphere Application Server V5.1.1 Cumulative Fix 13 for Linux
5.1.1.14: WebSphere Application Server V5.1.1 Cumulative Fix 14 for AIX
5.1.1.14: WebSphere Application Server V5.1.1 Cumulative Fix 14 for Linux
5.1.1.14: WebSphere Application Server V5.1.1 Cumulative Fix 14 for Windows
5.1.1.15: WebSphere Application Server V5.1.1 Cumulative Fix 15 for Windows
5.0.2.18: WebSphere Application Server 5.0.2 Cumulative Fix 18 for Linux
5.1.1.11: WebSphere Application Server V5.1.1 Cumulative Fix 11 for HP-UX
5.1.1.14: WebSphere Application Server V5.1.1 Cumulative Fix 14 for HP-UX
5.0.2.15: WebSphere Application Server 5.0.2 Cumulative Fix 15 for HP-UX
5.0.2.16: WebSphere Application Server 5.0.2 Cumulative Fix 16 for Linux
5.1.1.10: WebSphere Application Server V5.1.1 Cumulative Fix 10 for Solaris
5.1.1.15: WebSphere Application Server V5.1.1 Cumulative Fix 15 for AIX
5.1.1.15: WebSphere Application Server V5.1.1 Cumulative Fix 15 for HP-UX
5.1.1.16: WebSphere Application Server V5.1.1 Cumulative Fix 16 for HP-UX
5.1.1.16: WebSphere Application Server V5.1.1 Cumulative Fix 16 for Linux
5.1.1.15: WebSphere Application Server V5.1.1 Cumulative Fix 15 for Linux
5.1.1.19: WebSphere Application Server V5.1.1 Cumulative Fix 19 for HP-UX



APAR status
Closed as program error.

Error description
When using Message-driven beans (MDBs) within WebSphere
Application Server Version 5.x, a Listener Port must also be
defined. The Listener Port is used to deliver messages to the
MDBs. One of the properties of a Listener Port is Max retries,
which defines the number of times the Listener Port attempts to
deliver a message to an MDB before shutting itself down.
If a Message-driven bean (MDB) running within WebSphere
Application Server Version 5.x throws an error while processing
a message, the application server will roll the message back to
the queue where it originated from. The delivery count of the
message is then checked against the Max retries property of the
Listener Port associated with the MDB. If the delivery count is
greater than the value of Max retries, the Listener Port should
be shut down.

However, if an MDB throws a runtime exception while a message is
being processed, the Listener Port will continue to deliver
messages to the MDB even if the delivery count of the message is
greater than the value of Max retries!

For example, when a runtime exception is thrown from the
onMessage() method while processing message N, the Listener Port
continues to deliver messages (N+1), (N+2), etc. Sometimes it
stops after just delivering one more message, while at other
times it delivers several more messages before stopping. After
restarting the application server, the Listener Port redelivers
message N followed by (N+2), (N+3), etc. (assuming only (N+1)
was delivered following the exception).

This can lead to messages being processed out of their correct
sequence.
Local fix
NA
Problem summary
****************************************************************
* USERS AFFECTED: This problem affects customers who use the   *
*                 Java Message Service (JMS) functionality     *
*                 provided with WebSphere Application Server   *
*                 Version 5.x.                                 *
****************************************************************
* PROBLEM DESCRIPTION: When using Message-driven beans (MDBs)  *
*                      within WebSphere Application Server     *
*                      Version 5.x, a Listener Port must also  *
*                      be defined. The Listener Port is used   *
*                      to deliver messages to the MDBs. One    *
*                      of the properties of a Listener Port    *
*                      is Max retries, which defines the       *
*                      number of times the Listener Port       *
*                      attempts to deliver a message to an     *
*                      MDB before shutting itself down.  If    *
*                      a Message-driven bean (MDB)running      *
*                      within WebSphere Application Server     *
*                      Version 5.x throws an error while       *
*                      processing a message, the application   *
*                      server will roll the message back to    *
*                      the queue where it originated from.     *
*                      The delivery count of the message is    *
*                      then checked against the Max retries    *
*                      property of the Listener Port           *
*                      associated with the MDB. If the         *
*                      delivery count is greater than the      *
*                      value of Max retries, the Listener      *
*                      Port  should be shut down.              *
*                                                              *
*                      However, if an MDB throws a runtime     *
*                      exception while a message is being      *
*                      processed, the Listener Port will       *
*                      continue to deliver messages to the     *
*                      MDB even if the delivery count of the   *
*                      message is greater than the value of    *
*                      Max retries!                            *
*                                                              *
*                      For example, when a runtime exception   *
*                      is thrown from the onMessage() method   *
*                      while processing message N, the         *
*                      ListenerPort continues to deliver       *
*                      messages (N+1), (N+2), etc. Sometimes   *
*                      it stops after just delivering one more *
*                      message, while at other times it        *
*                      delivers several more messages before   *
*                      stopping. After restarting the          *
*                      application server, the Listener Port   *
*                      redelivers message N followed by (N+2), *
*                      (N+3), etc. (assuming only (N+1) was    *
*                      delivered following the exception).     *
*                                                              *
*                      This can lead to messages being         *
*                      processed out of their correct          *
*                      sequence.                               *
****************************************************************
* RECOMMENDATION:                                              *
****************************************************************
When an MDB's onMessage() method generates a runtime
exception, the Server Session associated with the MDB is
notified. The Session returns itself to the Server Session
Pool, before making a check to see if the Listener Port for
the MDB needs to be stopped. This check is made against
certain flags on the Server Session.

However, in between the Server Session being put back in the
Session Pool, and the check being made, the Server Session
can be removed from the pool and reused. This results in the
Session being re-initialised, and the fields that are used
in the check are reset. In this situation, the check to see
if the Listener Port needs to be stopped always fails,
leaving the Listener Port running.
Problem conclusion
The behaviour of the Server Session and Server Session Pool
has changed, so that when the maximum retries limit has been
reached, the Server Session sets a flag on the Server Session
Pool to indicate that it should be closed. This prevents any
new Server Sessions being returned from the pool. The Server
Session then stops the Listener Port asynchronously, to
prevent a deadlock situation from occurring.
Temporary fix Comments
APAR information
APAR number PQ89393
Reported component name WAS BASE 5.0
Reported component ID 5630A3600
Reported release 00W
Status CLOSED PER
PE NoPE
HIPER NoHIPER
Special Attention NoSpecatt
Submitted date 2004-05-26
Closed date 2004-06-08
Last modified date 2004-06-08

APAR is sysrouted FROM one or more of the following:

APAR is sysrouted TO one or more of the following:

Modules/Macros
msging          

Publications Referenced

Fix information

Applicable component levels
R003 PSY    UP
R00A PSY    UP
R00H PSY    UP
R00I PSY    UP
R00P PSY    UP
R00S PSY    UP
R00W PSY    UP
R103 PSY    UP
R10A PSY    UP
R10H PSY    UP
R10I PSY    UP
R10P PSY    UP
R10S PSY    UP
R10W PSY    UP


Document Information


Product categories: Software > Application Servers > Distributed Application & Web Servers > WebSphere Application Server > General
Operating system(s):
Software version: 00W
Software edition:
Reference #: PQ89393
IBM Group: Software Group
Modified date: Jun 8, 2004