Which two are true about message-driven beans? (Choose two.)
A) Message-driven beans do not expose a client view.
B) Message-driven beans must implement the JMSListener interface.
C) Message-driven beans cannot throw application exceptions.
D) Message-driven beans must not use bean-managed transaction demarcation.
E) Message-driven beans can use the getCallerPrincipal() method of MessageDrivenContext.
Dear Kathy,
To my knowledge the correct answers are: A and C!
A) True: because MDB is not intended to be accessible to the client and has no APIs for client.
B) MDB must implement the javax.ejb.MessageListener and MessageDrivenBean interfaces and not a JMSListener.
C) True: No application exceptions should be thrown from onMessage() method of MDB.
Only container can throw system exceptions from MDB methods.
D)
IllegalStateException will be thrown by the container if this method is called because MBD
methods are called by the container and do not run in a security context.
Please correct me if I am wrong!
Thank you!
Seid