MDB is unable to read message from jms queue
0 posts in topic
Thread View Thread View

MDB is unable to read message from jms queue...
Tue Mar 05, 2013 08:16 AM

I have a jms queue(myQueue) that has some messages. I have created a message driven bean(MDB) to read message  from that queue. But looks like my mdb is not triggered even though messages are present in the queue. I am using qbrowser to verify if messages are present or not in the queue. Also, I am not getting any exception when I deployed the mdb. I used the documentation at 
to create this mdb.
Here is my code: Queue name is myQueue. I dont understand why this mdb is not getting triggered. What are the possible causes ? I am not getting any exception also. help appreciated. thanks.

@MessageDriven(mappedName = "jms/myQueue")
public class NewMessageBean1 implements MessageListener {
    private MessageDrivenContext mdc;
    public void onMessage(Message inMessage) {
    TextMessage msg = null;
    try {
        if (inMessage instanceof TextMessage) {
            msg = (TextMessage) inMessage;
            System.out.println("MESSAGE BEAN: Message received: " +
        } else {
            System.out.println("Message of wrong type: " +
    } catch (JMSException e) {
    } catch (Throwable te) {

About | Sitemap | Contact