I'm tasked with sending a test message to an (as yet) unknown MQ endpoint.
I've stood a trial version of IBM WebSphere MQ (v8.0.0.5) on a server, which I believe is configured correctly.
However, given the code included below I get either the exception:
An unhandled exception of type 'IBM.WMQ.MQException' occurred in amqmdnet.dll
Additional information: 2059
Or if I am on the server itself using localhost
instead of the remote server name, the constructor line hangs.
This is C#:
Hashtable connectionProperties = new Hashtable();
string connectionType = MQC.TRANSPORT_MQSERIES_MANAGED
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, "server.com");
connectionProperties.Add(MQC.CHANNEL_PROPERTY, "SYSTEM.DEF.CLNTCONN");
break;
}
MQQueueManager qMgr = new MQQueueManager("test", connectionProperties);
MqClientTest mqClientTest=new MqClientTest("TEST_QM","localhost", "SYSTEM.DEF.CLNTCONN");
Is there anything we're missing in this?
Update 1:
In the amqerr01.log
file in the errors
folder, we now have the text:
AMQ6183: An internal WebSphere MQ error has occurred.
Update 2:
The "internal WebSphere MQ error" was likely due to my probing the 1414 port to see if the port was "up" and listening. Seems it was and it obviously didn't like me doing that.
Update 3:
@Roger suggested I use 127.0.0.1
and capitals, which I've now applied - and changed the example above to reflect.
@JoshMc kindly pointed to a second AMQERR01.LOG file within the Queue Manager folder. I now get the error:
14/11/2017 15:35:08 - Process(336.6) User(xxxx) Program(amqrmppa.exe) Host(xxxx) Installation(xxxx) VRMF(8.0.0.5) QMgr(TEST_QM) AMQ9519: Channel 'SYSTEM.DEF.CLNTCONN' not found.
EXPLANATION: The requested operation failed because the program could not find a definition of channel 'SYSTEM.DEF.CLNTCONN'.
TEST_QM
is my Queue Manager, with the default (?) channel SYSTEM.DEF.CLNTCONN
netstat -a
) then we found a Listener. So, we're now listening to 1414. – Program.XSYSTEM.
then the a defaultCHLAUTH
rule will block it. 2. If you are not being blocked by that rule because either you are using a different channel or disabled CHLAUTH, then what user are you connecting with, if it is a user in themqm
group or assuming you are on windows, any user in the windows administrator group, or theMUSR_MQADMIN
user, MQ v8 is configured by default to require a password to be specified viaCONNAUTH
for all Administrative users. – JoshMcAMQERR01.LOG
files, one that is in the errors directory directly below the MQ install location and one that is under the qmgrs/<qmgr name>/errors directory under the MQ install location, have you looked at the second location? – JoshMc