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 » p2p websphere mq jms provider

Post new topic  Reply to topic
 p2p websphere mq jms provider « View previous topic :: View next topic » 
Author Message
kotla.satya
PostPosted: Tue Apr 17, 2007 3:00 am    Post subject: p2p websphere mq jms provider Reply with quote

Apprentice

Joined: 30 Jan 2006
Posts: 40
Location: chennai-India

I have written a jms program which is as below, to access the Queconnection factory, and Queue Destination created in WebSphere Appserver.The queue Manager,channels and Queues are created physically on Websphere MQ. The jndi's are created in the websphere app server.

When I execute the program,I see a exception in the logs as 'javax.naming.NameNotFoundException: Object jms/MQQCF not found on queue manager QM_JFP' and I also see that server connection channel is running when I run the program.

Could any one please help me,as I am struck with this from 3 days.


Hashtable props = new Hashtable();
props.put(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.mq.jms.context.WMQInitialContextFactory");
props.put(Context.PROVIDER_URL,"202.60.210.46:1435/JMS_SVRCONN");
Context ctx = new InitialContext(props);
QueueConnectionFactory queueConnectionFactory=
(QueueConnectionFactory)ctx.lookup("jms/MQQCF");//JNDI name of QueueConnection factory

QueueConnection queueConnection=queueConnectionFactory.createQueueConnection();
Queue queue=(Queue)ctx.lookup("jms/SVRREQQ");//JNDI name for Queue Destination

QueueSession queueSession=queueConnection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
QueueSender queueSender=queueSession.createSender(queue);
TextMessage message=queueSession.createTextMessage();
message.setText("Sample message using jms");
queueSender.send(message);
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Apr 17, 2007 6:38 pm    Post subject: Reply with quote

Grand High Poobah

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

My suggestion:
Code:
Hashtable props = new Hashtable();
props.put(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.mq.jms.context.WMQInitialContextFactory");
props.put(Context.PROVIDER_URL,"202.60.210.46:1435");
Context ctx = new InitialContext(props);


My advice use Context ctx = new InitialContext();
Then use the ctx returned to inspect its properties. This would allow you then know exactly what you want to put into the hash table...

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
kotla.satya
PostPosted: Tue Apr 17, 2007 9:38 pm    Post subject: Reply with quote

Apprentice

Joined: 30 Jan 2006
Posts: 40
Location: chennai-India

Hi ,
Thanks for the reply
I am little bit new to JMS, I used ctx.getEnvironment() to see the default properties,they are as below.

{com.ibm.websphere.naming.hostname.normalizer=com.ibm.ws.naming.util.DefaultHostnameNormalizer, java.naming.factory.initial=com.ibm.websphere.naming.WsnInitialContextFactory, com.ibm.websphere.naming.name.syntax=jndi, com.ibm.websphere.naming.namespace.connection=lazy, com.ibm.ws.naming.ldap.ldapinitctxfactory=com.sun.jndi.ldap.LdapCtxFactory, com.ibm.websphere.naming.jndicache.cacheobject=populated, com.ibm.websphere.naming.namespaceroot=defaultroot, com.ibm.ws.naming.wsn.factory.initial=com.ibm.ws.naming.util.WsnInitCtxFactory, com.ibm.websphere.naming.jndicache.maxcachelife=0, com.ibm.websphere.naming.jndicache.maxentrylife=0, com.ibm.websphere.naming.jndicache.cachename=providerURL, java.naming.provider.url=corbaloc:rir:/NameServiceServerRoot, java.naming.factory.url.pkgs=com.ibm.ws.runtime:com.ibm.ws.naming}

and for the context with properties for the below code the out put is ,

Hashtable props = new Hashtable();
props.put(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.mq.jms.context.WMQInitialContextFactory");
props.put(Context.PROVIDER_URL,"202.60.210.46:1414/JMS_SVRCONN");
Context ctx = new InitialContext(props);

{java.naming.provider.url=202.60.210.46:1414/JMS_SVRCONN, java.naming.factory.initial=com.ibm.mq.jms.context.WMQInitialContextFactory, java.naming.factory.url.pkgs=com.ibm.ws.runtime:com.ibm.ws.naming}

Could you please guide me, as I am not sure how to proceed.

Thank you
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Apr 18, 2007 2:10 pm    Post subject: Reply with quote

Grand High Poobah

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

NameServiceServerRoot, is certainly not JMS_SVRCONN... unless you called your main node for WAS JMS_SVRCONN???

Your setup implies the use of a support pack m?0c or something like it which requires ms0b and accesses dynamically the qmgr... I can only say this: while it works, this is a bad idea from a standard J2EE point of view...

Set up the properties correctly in the file or the WAS admin console and use a static JMS base. If you need dynamic stuff you can always use the URI form for your destinations. ...

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
kotla.satya
PostPosted: Thu Apr 26, 2007 3:43 am    Post subject: Reply with quote

Apprentice

Joined: 30 Jan 2006
Posts: 40
Location: chennai-India

Hi ,

I did not understand the term 'static JMS base' in your reply. I have ms0b and me01 service packs in the lib folder.

I found my code working ,I mean I am able to post messages when I use the default context, but I could not figure out how this works. The code is as below

Context ctx = new InitialContext();
QueueConnectionFactory queueConnectionFactory=(QueueConnectionFactory)ctx.lookup("jms/MQQCF");

QueueConnection queueConnection=queueConnectionFactory.createQueueConnection();
Queue queue=(Queue)ctx.lookup("jms/SVRREQQ");
QueueSession queueSession=queueConnection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
QueueSender queueSender=queueSession.createSender(queue);
TextMessage message=queueSession.createTextMessage();
...

Can any one please post site names and sample programs for learning JMS with websphere MQ JMS provider in Websphere.

Thank you.
Back to top
View user's profile Send private message
marcin.kasinski
PostPosted: Thu Apr 26, 2007 4:31 am    Post subject: Reply with quote

Sentinel

Joined: 21 Dec 2004
Posts: 850
Location: Poland / Warsaw

http://www-128.ibm.com/developerworks/edu/i-dw-i-mqrad1.html
http://www-128.ibm.com/developerworks/edu/i-dw-i-mqrad2.html
http://www-128.ibm.com/developerworks/edu/i-dw-i-mqrad3.html

...

http://www-128.ibm.com/developerworks/websphere/techjournal/0505_woolf/0505_woolf.html

http://www-128.ibm.com/developerworks/java/library/j-jms/

...
_________________
Marcin
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » p2p websphere mq jms provider
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.