5.1 Create a Queue Activation Specification
Log into Websphere Application Server 7 Admin Console
Resources -> JMS -> Activation specifications
Click on ‘New’ button
Click on ‘OK’ button
Type QueueActSpec for Name
jms/QueueActSpec for JNDI name
Select Queue as Destination type
Type jms/Queue for Destination JNDI name
Select InternalJMS as Bus name
Click on ‘OK’ button (not shown in the screenshot)
Click on ‘Save’ link.
5.2 Create a queue message driven bean
@MessageDriven(name="queueMessageDrivenBean") public class QueueMessageDrivenBean implements MessageListener { @Override public void onMessage(Message message) { try { TextMessage txtMessage = (TextMessage) message; System.out.println(txtMessage.getText() + " processed....Orz"); } catch (JMSException ex) { throw new EJBException(ex); } } }
In ibm-ejb-jar-bnd.xml
<message-driven name="queueMessageDrivenBean"> <jca-adapter activation-spec-binding-name="jms/QueueActSpec"/> </message-driven>
Test the servlet created in step 4 and check the result
[26/08/11 11:11:33:812 EST] 0000008f SystemOut O Message Sent
[26/08/11 11:11:33:812 EST] 000000a4 SystemOut O Hello World processed....Orz
Binding another message driven bean to the same queue destination won’t cause exceptions, but only one message driven bean is able to process the message.
I followed everything step by step, but did not get the expected result. the server does not load the application. I edited the file ibm-ejab-jar-bnd.xml correctly and created activation specification on the server. Missing anything else?
ReplyDeletecom.ibm.ejs.container.EJBConfigurationException: REQUIRED_BINDING_NOT_FOUND for MDB: queueMessageDrivenBean
I am also getting the same exception in my local machine with same configuration like WAS8.5 and WMQ8
ReplyDeleteCan you try with Activation specification provider with WebSphere
ReplyDelete