File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Question on Message Driven Beans Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Question on Message Driven Beans" Watch "Question on Message Driven Beans" New topic

Question on Message Driven Beans

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9999


In the @MessageDriven annotation, we have an attribute called messageListenerInterface. Why do we need to specify this when the MDB class imements this in it's declaration?

SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Sergio Tridente
Ranch Hand

Joined: Mar 22, 2007
Posts: 329

Hi Jothi,

Accordingly to section 5.4.2 of the ejb core specification:

If the message-driven bean class implements more than one interface other than,, or any of the interfaces defined by the javax.ejb package, the message listener interface must be specified by the messageListenerInterface element of the MessageDriven annotation or the messaging-type element of the message-driven deployment descriptor element.

SCJP 1.4 (88%) - SCJP 5.0 Upgrade (93%) - SCWCD 1.4 (97%) - SCBCD 5.0 (98%)
I agree. Here's the link:
subject: Question on Message Driven Beans
It's not a secret anymore!