Author |
Message
|
plivingstone |
Posted: Tue Nov 11, 2014 9:05 am Post subject: Cannot access Websphere MQ on new Windows machine |
|
|
Novice
Joined: 11 Nov 2014 Posts: 11
|
Hi,
I am a newbie on Websphere MQ setup and configuration, so I am sorry of this question has already been asked ...
I have an application that has been working fine on a Windows XP box, and a Windows Server 2008 server (64 bit).
It connects to an IBM iSeries/AS400 Message Queue.
Now I need to upgrade the code and deploy it on a new Win7 64 bit machine.
So I ran the setup for Websphere MQ (it's in a folder 'mqc6_6.0.2.6_win\Windows') and it then ran the Prepare Websphere MQ Wizard which also finished successfully.
But when I run my application I get the error
Quote: |
MQRC_Q_MGR_NAME_ERROR |
as I say, this application runs fine on other machines including a 64 bit machine with the same Message Queue, so what am I missing?
Is there something else I need to do for the setup?
Thanks for any help |
|
Back to top |
|
 |
bruce2359 |
Posted: Tue Nov 11, 2014 10:34 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
Look at the error logs on the iSeries box. What error do you find there?
How does the app execution on Windows specify connection information? MQSERVER= or client channel definition table (CCDT) to the iSeries box? _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
plivingstone |
Posted: Tue Nov 11, 2014 11:26 am Post subject: RE: connection |
|
|
Novice
Joined: 11 Nov 2014 Posts: 11
|
Hi,
Thanks for your reply. here is the code that tries to access the queue (in c#):
Code: |
Hashtable connectionProperties = init(connectionType);
MQQueueManager gMQQueueManager = new MQQueueManager(); // IBM.WMQ.MQQueueManager
MQQueue gMQQueue;
// Initialise new queue manager
gMQQueueManager = new MQQueueManager(QManager, connectionProperties);
if (gMQQueueManager != null)
{
//int openOptions = MQC.MQOO_INQUIRE;
gMQQueue = gMQQueueManager.AccessQueue(QName, MQC.MQOO_INPUT_AS_Q_DEF + MQC.MQOO_BROWSE + MQC.MQOO_FAIL_IF_QUIESCING + MQC.MQOO_INQUIRE); //AccessQueue(qName, openOptions);
depth = gMQQueue.CurrentDepth;
MQDepth = (depth > 0) ? depth.ToString() : "0";
// Close MQ Queue
gMQQueue.Close();
}
|
and the settings used are:
* hostname="IP ADDRESS"
* channel="SYSTEM.DEF.SVRCONN"
* qmanager="BOCTEST"
* QName="BOC.TO.EDB"
plus of course there are the standard connection properties. stored in the HashTable connectionProperties and these are set in the 'init' function like this:
Code: |
connectionProperties.Add(MQC.TRANSPORT_PROPERTY, connectionType);
// Set up the rest of the connection properties, based on the
// connection type requested
switch (connectionType)
{
case MQC.TRANSPORT_MQSERIES_BINDINGS:
break;
case MQC.TRANSPORT_MQSERIES_CLIENT:
case MQC.TRANSPORT_MQSERIES_XACLIENT:
case MQC.TRANSPORT_MQSERIES_MANAGED:
connectionProperties.Add(MQC.HOST_NAME_PROPERTY, hostName);
connectionProperties.Add(MQC.CHANNEL_PROPERTY, channel);
break;
}
|
|
|
Back to top |
|
 |
bruce2359 |
Posted: Tue Nov 11, 2014 1:38 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
Look at the error logs on the iSeries box. What error do you find there? _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
plivingstone |
Posted: Wed Nov 12, 2014 2:07 am Post subject: Environment Variabls (DOH!) |
|
|
Novice
Joined: 11 Nov 2014 Posts: 11
|
So the solution was annoyingly and gratifyingly simple...
We need to specify the MQSERVER in an environment variable, which I had missed.
So once I set MQSERVER=SYSTEM.DEF.SVRCONN/TCP/BOCTEST it worked fine. |
|
Back to top |
|
 |
gbaddeley |
Posted: Wed Nov 12, 2014 2:25 pm Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
MQ version 6.0.2.6? You are running in the dark ages! You should have installed a version that is supported by IBM.
There should be no need to set MQSERVER, all that config info should be set in the connection properties in the Java prog. _________________ Glenn |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Nov 12, 2014 5:55 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
gbaddeley wrote: |
MQ version 6.0.2.6? You are running in the dark ages! You should have installed a version that is supported by IBM.
There should be no need to set MQSERVER, all that config info should be set in the connection properties in the Java prog. |
I thought you missed something... This is C# and not java. So yes there is need for the MQSERVER environment variable...although we were not told what the content of the hashtable was in the connection call....  _________________ MQ & Broker admin |
|
Back to top |
|
 |
gbaddeley |
Posted: Sun Nov 16, 2014 4:28 pm Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
Sorry, it is C#, not Java. My bad. _________________ Glenn |
|
Back to top |
|
 |
vsathyan |
Posted: Mon Dec 29, 2014 8:27 am Post subject: |
|
|
Centurion
Joined: 10 Mar 2014 Posts: 121
|
Comment out the below line
Code: |
MQQueueManager gMQQueueManager = new MQQueueManager(); // IBM.WMQ.MQQueueManager
|
and use like below
Code: |
MQQueueManager gMQQueueManager = new MQQueueManager(QManager, connectionProperties);
|
You will be able to connect without setting the MQSERVER environment variable provided that you have set the MQC.CHANNEL_PROPERTY, MQC.HOSTNAME_PROPERTY, MQC.PORT_PROPERTY and MQC.TRANSPORT_PROPERTY in the hashtable. And yes, you will NOT face MQRC_Q_MGR_NAME_ERROR also.
Have fun.  |
|
Back to top |
|
 |
|