This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes about the onMessage method of MDB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "about the onMessage method of MDB" Watch "about the onMessage method of MDB" New topic

about the onMessage method of MDB

carlo sciandrone

Joined: Feb 26, 2012
Posts: 5
Hi I have a theoretical question about this method, I post it because I fear not having understood well the logic behind it.
Application exception are defined as exceptions which the client is expected to handle.
Any Exception can be made an application exception by annotating it with @ApplicationException.
A Message Driven Bean can throw only unchecked exceptions from its onMessage method so if I annotate my RuntimeException with @ApplicationException I can do it.
But a MDB does not have a client invoking it so does it make sense to have this possibility?
Anirudh Gupta
Ranch Hand

Joined: Dec 08, 2010
Posts: 48

Please refer the below,

Chapter 5 - Message Driven Bean Component Contract
5.4 - Protocol Between a Message-Driven Bean Instance and its Container
5.4.18 - Dealing with Exceptions

The below URL is where you can download the EJB3.1 specs from.
EJB Specs

Hope it helps.


subject: about the onMessage method of MDB
It's not a secret anymore!