|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
async listnr active, can't use this method on another thread |
« View previous topic :: View next topic » |
Author |
Message
|
klingelb |
Posted: Fri Jan 14, 2005 11:29 am Post subject: async listnr active, can't use this method on another thread |
|
|
 Apprentice
Joined: 25 Sep 2002 Posts: 28
|
Has anyone seen the JMSException before: "an async listener is active, cannot use this method on another thread"
Code Blocks
Init Code Block
connection = connfact.createQueueConnection();
connection.start();
session = connection.createQueueSession(false,QueueSession.AUTO_ACKNOWLEDGE);
receiver = session.createReceiver(input);
receiver.setMessageListener(this);
sender = session.createSender(output);
Next Code Block
ObjectMessage request = session.createObjectMessage();
request.setObject((Serializable) message);
request.setJMSReplyTo((MQeJMSJNDIQueue) input);
sender.send(request);
The last method sender.send(request); throws a JMSException
with no error code, no linked message, but a detailed message of
"an async listener is active, cannot use this method on another thread"
any ideas how i can force the sender.send(request) method to be invoked
from the correct thread |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Jan 14, 2005 12:07 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Is your destination queue an extension of javax.jms.Destination ??
Is there a default path from your connection qmgr to the qmr hosting that destination?
What else are you trying to do that is not fully standard ?
Enjoy  |
|
Back to top |
|
 |
klingelb |
Posted: Fri Jan 14, 2005 12:16 pm Post subject: nothing out of the norm |
|
|
 Apprentice
Joined: 25 Sep 2002 Posts: 28
|
yes my destination queue is an extension of javax.jms.Destination
I am just sending the message to a local application queue on my local MQe Qmgr.
My application is an eclipse based application and I am using MQe and MQeJMS libraries that JMS 1.1 level |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Jan 14, 2005 12:30 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
I am not sure that MQe is slotted to do send and receive at the same time on the same queue? You'll have to check the documentation about restrictions.
A way around would be to have the thread do everything:
get the qcf, connection, session, sender, send, close resources...
Enjoy  |
|
Back to top |
|
 |
klingelb |
Posted: Fri Jan 14, 2005 3:26 pm Post subject: solution |
|
|
 Apprentice
Joined: 25 Sep 2002 Posts: 28
|
my problem was that i was using the same QueueSession for my sender and async receiver.
when i created a separate session for each it solved the problem.
thanks for you help though. |
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Jan 15, 2005 7:03 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
It's never a good idea to keep stuff that should not be in the same Unit of Work in the same session. Per definition an asynchronous receiver should have it's own session.
Glad you worked it out.
F.J. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|