|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Get NameNotFoundException when trying to do context lookup |
« View previous topic :: View next topic » |
Author |
Message
|
sijtom0703 |
Posted: Fri Dec 30, 2011 10:52 am Post subject: Get NameNotFoundException when trying to do context lookup |
|
|
 Voyager
Joined: 28 May 2011 Posts: 84 Location: USA
|
Hi,
I am new to JMS coding and JNDI. I tried to do a Context lookup in my simple JMS code and it is throwing error saying below:
Quote: |
javax.naming.NameNotFoundException: Object MQQueueConnectionFactory not found on queue manager SOURCE.QM |
The below is the code I am Running
Code: |
Hashtable props = new Hashtable();
props.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY,"com.ibm.mq.jms.context.WMQInitialContextFactory");
props.put(javax.naming.Context.PROVIDER_URL,"SOURCE.QM");
Context qmContext = new javax.naming.InitialContext(props);
MQQueueConnectionFactory cf = (MQQueueConnectionFactory) qmContext.lookup("MQQueueConnectionFactory");
|
How can I setup MQQueueConnectionFactory in Queue Manager. I had setup externally using MQ Explorer JMS Administered Objects.
[/quote] |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Dec 30, 2011 1:59 pm Post subject: Re: Get NameNotFoundException when trying to do context look |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
sijtom0703 wrote: |
Hi,
I am new to JMS coding and JNDI. I tried to do a Context lookup in my simple JMS code and it is throwing error saying below:
Quote: |
javax.naming.NameNotFoundException: Object MQQueueConnectionFactory not found on queue manager SOURCE.QM |
The below is the code I am Running
Code: |
Hashtable props = new Hashtable();
props.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY,"com.ibm.mq.jms.context.WMQInitialContextFactory");
props.put(javax.naming.Context.PROVIDER_URL,"SOURCE.QM");
Context qmContext = new javax.naming.InitialContext(props);
MQQueueConnectionFactory cf = (MQQueueConnectionFactory) qmContext.lookup("MQQueueConnectionFactory");
|
How can I setup MQQueueConnectionFactory in Queue Manager. I had setup externally using MQ Explorer JMS Administered Objects.
|
[/quote]
OK so here is a piece of advice. IBM likes to use the initial context factory type you described above... Unless you are getting your context from WAS, do not use it. It is not suitable for a full blown testing or J2EE environment.
It is only suitable for IBM demonstrations.
Instead look into the file based JNDI and setup the file context (.bindings file)
Have fun  _________________ MQ & Broker admin |
|
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
|
|
|
|