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

  • Home
  • SEARCH
  • 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 491299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T01:59:49+00:00 2026-05-13T01:59:49+00:00

I try to receive a JMS message in an EJB2 (legacy sucks ;-) stateless

  • 0

I try to receive a JMS message in an EJB2 (legacy sucks 😉 stateless session bean, in weblogic 10.0.1, with bean managed transactions. Queue definition from jms folder looks like

<uniform-distributed-queue name="ReqQueue">
  <default-targeting-enabled>true</default-targeting-enabled>
  <delivery-params-overrides>
    <delivery-mode>Non-Persistent</delivery-mode>
  </delivery-params-overrides>
  <quota>QuotaCrc</quota>
  <jndi-name>xxx.ReqQueue</jndi-name>
  <load-balancing-policy>Round-Robin</load-balancing-policy>
</uniform-distributed-queue>
<uniform-distributed-queue name="RespQueue">
  <default-targeting-enabled>true</default-targeting-enabled>
  <delivery-params-overrides>
    <delivery-mode>Non-Persistent</delivery-mode>
  </delivery-params-overrides>
  <quota>QuotaCrc</quota>
  <jndi-name>xxx.RespQueue</jndi-name>
  <load-balancing-policy>Round-Robin</load-balancing-policy>
</uniform-distributed-queue>

The business method in the bean does not start a transaction, so the JMS operations are not transactional. The executed code is

InitialContext ictx = new InitialContext();
QueueConnectionFactory cf = (QueueConnectionFactory) 
                       ictx.lookup("weblogic.jms.ConnectionFactory");
Queue responseQueue = (Queue) ictx.lookup("RespQueue");
conn = cf.createConnection();
session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageConsumer receiver = session.createConsumer(responseQueue);
ObjectMessage response = (ObjectMessage) receiver.receive(30000);

The problem is that receiver.receive returns null immediately without any blocking, regardless of the contents of the queue. According to the JMS API doc., receiver.receive with a timeout returns null after the timeout or immediately if the destination is closed. The problem is the same if I use bean managed transactions, container managed transactions or no transactions at all. Posting a JMS message to another queue works. Receive returns null immediately regardless if I do a send before in the same method or not.

Why is the queue closed, or why does it seem so?

Unfortunately MDB is not an option because we have to tunnel a synchronous call through JMS (and I don’t want to fool around too much in the Ball of Mud 😉

  • 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-13T01:59:49+00:00Added an answer on May 13, 2026 at 1:59 am

    Before
    MessageConsumer receiver = session.createConsumer(responseQueue);
    put
    conn.start();

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

Sidebar

Related Questions

I receive this message (see image below) when I try to edit in debugging.
I have to send and receive dynamic data using a SysV message queue for
I try to define a schema for XML documents I receive. The documents look
I am using Glassfish JMS. I am able to add messages to a queue.
How can I instantiate a JMS queue listener in java (JRE /JDK / J2EE
My program use UdpClient to try to receive 27 responses from 27 hosts. The
Try loading this normal .jpg file in Internet Explorer 6.0. I get an error
try { ... } catch (SQLException sqle) { String theError = (sqle).getSQLState(); ... }
I try to fetch a Wikipedia article with Python's urllib: f = urllib.urlopen(http://en.wikipedia.org/w/index.php?title=Albert_Einstein&printable=yes) s
I try to add an addons system to my Windows.Net application using Reflection; but

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.