Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6873621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:05:30+00:00 2026-05-27T04:05:30+00:00

I have a asynchronous JMS receiver coded thus (obvious details missing): connection = connectionFactory.createConnection();

  • 0

I have a asynchronous JMS receiver coded thus (obvious details missing):

connection = connectionFactory.createConnection();
connection.setExceptionListener(new ExceptionListener() {
    @Override
    public void onException(JMSException ex) {
        logger.info("JMS exception " + ex.getMessage());
    }
});

session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
consumer = session.createConsumer(queue);
consumer.setMessageListener(listener);
logger.info("Waiting for a message");
connection.start();

Everything starts up nicely, but when a message arrives I get a JMSException which the ExceptionListener picks up. The exception says:

javax.jms.JMSException: MQJMS2002: failed to get message from MQ queue.
at com.ibm.msg.client.wmq.v6.jms.internal.ConfigEnvironment.newException(ConfigEnvironment.java:374)
at com.ibm.msg.client.wmq.v6.jms.internal.MQMessageConsumer.getMessage(MQMessageConsumer.java:3047)
at com.ibm.msg.client.wmq.v6.jms.internal.MQMessageConsumer.receiveAsync(MQMessageConsumer.java:4042)
at com.ibm.msg.client.wmq.v6.jms.internal.SessionAsyncHelper.run(SessionAsyncHelper.java:507)
at java.lang.Thread.run(Thread.java:662)

The linked exception just says NullPointerException and gives no other details.

I’ve trawled the web looking for an answer but I am no MQ expert and have got nowhere with this. The middleware people here are not very helpful and getting them to do anything is proving slow and painful. I get the impression it’s something to do with queue config but I feel I am clutching at straws.

If anyone has got any suggestions I would be grateful – especially if it is something I can arm myself with and confront middleware 🙂

I’m using the MQ 7.0.0.2 client jars.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T04:05:31+00:00Added an answer on May 27, 2026 at 4:05 am

    Embarrassingly I have just found that a bit of the ‘obvious’ code that I skipped above had a finally block in it that closed the connection shortly after it was opened. Not sure why the error message has to be so vague – telling me that the connection was closed would have saved me hours of head scratching.

    Thanks for those that took time to read through my problem!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have few asynchronous tasks running and I need to wait until at least
I have been researching asynchronous messaging, and I like the way it elegantly deals
Using a .NET TcpClient if I have called an asynchronous BeginRead() on the associated
I have a rails app that has asynchronous processing, and I'm having trouble getting
I have a question on the best way of exposing an asynchronous remote interface.
I have a legacy C++ application that uses DDS for asynchronous communication/messaging. I need
I have not been able to find a way to cancel/terminate asynchronous read operation
I have a contact us form that uses Ajax (i.e. relies on asynchronous requests).
My form receives asynchronous callbacks from another object on random worker threads. I have
I have an asynchronous library which is compiled under .NET 3.5, since it's used

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.