|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
question about Contructor of MQQueueManager |
« View previous topic :: View next topic » |
Author |
Message
|
weixiazero |
Posted: Fri Dec 15, 2006 11:55 pm Post subject: question about Contructor of MQQueueManager |
|
|
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 |
|
 |
wschutz |
Posted: Sat Dec 16, 2006 3:48 am Post subject: |
|
|
 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 |
|
 |
weixiazero |
Posted: Sat Dec 16, 2006 5:45 am Post subject: |
|
|
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 |
|
 |
|
|
 |
|
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
|
|
|
|