ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » async listnr active, can't use this method on another thread

Post new topic  Reply to topic
 async listnr active, can't use this method on another thread « View previous topic :: View next topic » 
Author Message
klingelb
PostPosted: Fri Jan 14, 2005 11:29 am    Post subject: async listnr active, can't use this method on another thread Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Fri Jan 14, 2005 12:07 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
klingelb
PostPosted: Fri Jan 14, 2005 12:16 pm    Post subject: nothing out of the norm Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Fri Jan 14, 2005 12:30 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
klingelb
PostPosted: Fri Jan 14, 2005 3:26 pm    Post subject: solution Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Sat Jan 15, 2005 7:03 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » async listnr active, can't use this method on another thread
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.