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 API Support » question about Contructor of MQQueueManager

Post new topic  Reply to topic
 question about Contructor of MQQueueManager « View previous topic :: View next topic » 
Author Message
weixiazero
PostPosted: Fri Dec 15, 2006 11:55 pm    Post subject: question about Contructor of MQQueueManager Reply with quote

Novice

Joined: 23 Apr 2006
Posts: 10

I have a piece of source code like following:
MQEnvironment.hostname = hostname;
MQEnvironment.channel = channel;
MQEnvironment.port = port;
MQEnvironment.userID = userID;
MQEnvironment.password = password;
MQQueueManager mqQmgr = new MQQueueManager(qmgrName);
It runs very well until I have made some change to it as follows:
Hashtable env = new Hashtable();
env.put(MQC.HOST_NAME_PROPERTY,hostname);
env.put(MQC.CHANNEL_PROPERTY,channel);
env.put(MQC.PORT_PROPERTY,String.valueOf(port));
env.put(MQC.USER_ID_PROPERTY,userID);
env.put(MQC.PASSWORD_PROPERTY,password);
env.put(MQC.TRANSPORT_PROPERTY,MQC.TRANSPORT_MQSERIES_CLIENT);
env.put(MQC.THREAD_AFFINITY,new Boolean(true));
MQQueueManager mqQmgr = new MQQueueManager(qmgrName,env);
I got an MQException with complete code 2, reason code 2059, which means the target queue manager is not available.
I have confirmed that the queue manager,listener,port are all no problem, and after I go back to use MQEnvironment it runs OK again.
Can anybody tell me what's wrong with my source code?
Thanks in advance for your kind.
Back to top
View user's profile Send private message
wschutz
PostPosted: Sat Dec 16, 2006 3:48 am    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

Perhaps this:
Quote:
env.put(MQC.PORT_PROPERTY,String.valueOf(port));
??
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
weixiazero
PostPosted: Sat Dec 16, 2006 5:45 am    Post subject: Reply with quote

Novice

Joined: 23 Apr 2006
Posts: 10

wschutz wrote:
Perhaps this:
Quote:
env.put(MQC.PORT_PROPERTY,String.valueOf(port));
??


Thank you wschutz.
I was so careless that have not pay attention to this.
After changing String.valueOf(port) to new Integer(port), I have got the new source to run very well.

Thanks again for you help.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » question about Contructor of MQQueueManager
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.