thuy nguyen wrote:I cut and paste this paragraph from the specification:
The message-driven bean class may have superclasses and/or superinterfaces. If the message-driven
bean has superclasses, the methods of the message listener interface, lifecycle callback interceptor
methods, the timeout method, the ejbCreate method, and the methods of the MessageDriven-
Bean interface may be defined in the message-driven bean class or in any of its superclasses. A message-
driven bean class must not have a superclass that is itself a message-driven bean class
Since a MDB can not subclass another MDB, it can only subclass a POJO. It is strange that a POJO can have
"the methods of the message listener interface, lifecycle callback interceptor methods, the timeout method, the ejbCreate method, and the methods of the MessageDriven-Bean interface"
That is not strange really. You can create a POJO superclass, which has onMessage method, and which is implementing the appropriate interface, say MessageListener.
That you create just a empty class which subclasses your superclass, has @MessageDriven annotation, and no onMessage method. This is valid. onMessage method for MDB will be picked up from superclass.