EJB 3.0 Core Specification
If the message-driven bean class implements more than one interface other than java.io.Serializable,
java.io.Externalizable, 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.
Well i had this inherant feeling like my most of the quesions on Session beans, that the above statement will again contradict my code experience
and it did.
I have a MDB as shown below
ShippingRequestProcessorMDB MDB implements javax.ejb.SessionBean and javax.ejb.MessageDriven interface and it does not specify the message listener
via messageListenerInterface element of MessageDriven nor through any elements in DD. Still things worked perfectly fine.
22:52:34,750 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=chapter4.ear,jar=chapter4-ejb.jar,name=ShippingRequestMessageConsumer,service=EJB3 with dependencies:
22:52:34,812 INFO [EJBContainer] STARTED EJB: com.ejb3inaction.actionbazaar.buslogic.ShippingRequestProcessorMDB ejbName: ShippingRequestMessageConsumer
22:52:34,812 WARN [MessagingContainer] Could not find the queue destination-jndi-name=queue/ShippingRequestQueue
22:52:34,812 WARN [MessagingContainer] destination not found: queue/ShippingRequestQueue reason: javax.naming.NameNotFoundException: ShippingRequestQueue not bound
22:52:34,828 WARN [MessagingContainer] creating a new temporary destination: queue/ShippingRequestQueue
22:52:34,843 INFO [ShippingRequestQueue] Bound to JNDI name: queue/ShippingRequestQueue
22:52:34,906 INFO [EJB3Deployer] Deployed: file:/E:/DJ/Certifications/Java/SCBCD/Application Servers/JBOSS/jboss-4.2.3.GA/server/default/tmp/deploy/tmp37578chapter4.ear-contents/chapter4-ejb.jar
22:52:35,109 INFO [EARDeployer] Started J2EE application: file:/E:/DJ/Certifications/Java/SCBCD/Application Servers/JBOSS/jboss-4.2.3.GA/server/default/deploy/chapter4.ear
22:52:35,265 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8080
22:52:35,296 INFO [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
22:52:35,343 INFO [Server]
JBoss (MX MicroKernel) [4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181417)] Started in 27s:781ms
22:53:26,250 INFO [STDOUT] INSERT INTO SHIPPING_REQUESTS(ITEM, SHIPPING_ADDRESS, SHIPPING_METHOD, INSURANCE_AMOUNT) VALUES ( 10101, '101 Easy Street', ' Snail mail', 101.0)
22:53:26,250 INFO [STDOUT] Shipping request processed.
Have i done something wrong??? Why is this contradicting behavior?