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 » MQ on AIX and connecting thru WAS 5

Post new topic  Reply to topic
 MQ on AIX and connecting thru WAS 5 « View previous topic :: View next topic » 
Author Message
sanedevil
PostPosted: Wed Jun 08, 2005 7:33 am    Post subject: MQ on AIX and connecting thru WAS 5 Reply with quote

Newbie

Joined: 08 Jun 2005
Posts: 6

Hi,
I'm new to the MQ world.

We have MQ running on an AIX machine. I want to receive the messages
1. using the APIs.
2. using MDB.

I've done the ff:
1. Created a Q connection factory
2. Created a Queue
3. Created a listener

However, for the 1st scenario, I get the ff error:
Method createManagedConnctionWithMCWrapper caught an exception during creation of the ManagedConnection for resource jms/b2bqconfactory, throwing ResourceAllocationException. Original exception: javax.resource.spi.ResourceAdapterInternalException: createQueueConnection failed

For the 2nd scenario, I am not able to start the listener.

I'm sure I'm missing something.
Pls help

tx in adv
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
vennela
PostPosted: Wed Jun 08, 2005 8:04 am    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

What do you mean
Quote:
1. using the APIs.


Stand alone java programs ?

Where did you store the JNDI definitions.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sanedevil
PostPosted: Wed Jun 08, 2005 7:54 pm    Post subject: Reply with quote

Newbie

Joined: 08 Jun 2005
Posts: 6

I'm trying to connect using the IntialContext and JMS API. Here's the code.

initCtx = new InitialContext();
QueueConnectionFactory qcf = (QueueConnectionFactory)initCtx.lookup("jms/b2bqconfactory");
QueueConnection conn = qcf.createQueueConnection();
QueueSession session = conn.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
Queue q = (Queue) initCtx.lookup("jms/b2bqueue");

QueueReceiver receiver = session.createReceiver(q);
Message msg = receiver.receive();
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
bower5932
PostPosted: Thu Jun 09, 2005 2:07 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

For your stand alone program, you'll find plenty of examples at:

http://www.developer.ibm.com/isv/tech/sampmq.html

I'd suggest starting with one of these.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
fjb_saper
PostPosted: Thu Jun 09, 2005 12:04 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

sanedevil wrote:
I'm trying to connect using the IntialContext and JMS API. Here's the code.

initCtx = new InitialContext();
QueueConnectionFactory qcf = (QueueConnectionFactory)initCtx.lookup("jms/b2bqconfactory");
QueueConnection conn = qcf.createQueueConnection();
QueueSession session = conn.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
Queue q = (Queue) initCtx.lookup("jms/b2bqueue");
QueueReceiver receiver = session.createReceiver(q);
//before you can receive anything you must start the connection
conn.start();

Message msg = receiver.receive();


Don't forget to close the receiver, close the session and close the connection once you are done.

Enjoy
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 » MQ on AIX and connecting thru WAS 5
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.