Author |
Message
|
dbwsi |
Posted: Fri Sep 16, 2011 3:59 am Post subject: Using CCDT with XMS - 2277 error |
|
|
Newbie
Joined: 16 Sep 2011 Posts: 6
|
I'm trying to use XMS.Net to connect using a CCDT, but all I get is an error with reason 2277.
Error log says:
AMQ9498: The MQCD structure supplied was not valid.
EXPLANATION:
The value of the 'ChannelName' field has the value '0'. This value is invalid
I'm getting the ConnectionFactory from a .bindings file, and all works fine when the ChannelName is set explicitly and I use Managed mode. However, when I switch to use a CCDT and UnManaged mode (for SSL) I get the error.
My digging in the last few days turned up APAR IZ76986
which says XMS doesn't support WMQ_CCDTURL and to use environment variables intstead. However, this doesn't work either, and neither does using the Channels stanza of mqclient.ini.
I've run some traces to comare my app with amqsputc, which does work.
This is my code
Code: |
private void button1_Click(object sender, EventArgs e)
{
this.txtLog.Text = "Starting..." + Environment.NewLine;
try
{
IConnectionFactory connectionFactory = CreateConnectionFactory();
Log("Found connection factory...");
Log(connectionFactory.ToString());
Log("End of connection factory settings");
Log(XMSC.WMQ_CCDTURL + ": " + connectionFactory.GetStringProperty(XMSC.WMQ_CCDTURL)); // To prove it is blank
using (IConnection connection = connectionFactory.CreateConnection(null, null))
{
using (ISession session = connection.CreateSession(false, AcknowledgeMode.AutoAcknowledge))
{
using (IDestination destination = (IDestination)this.initialContext.Lookup(this.txtDestinationName.Text))
{
using (IMessageProducer producer = session.CreateProducer(destination))
{
// Start the connection
connection.Start();
IMessage msg = session.CreateTextMessage(this.txtMessage.Text);
producer.Send(msg);
Log("Message Sent");
}
}
}
}
}
catch (Exception ex)
{
Log(ex.ToString());
}
}
private IConnectionFactory CreateConnectionFactory()
{
IConnectionFactory cf;
// Create an initial context instance
Hashtable env = new Hashtable();
env[XMSC.IC_URL] = this.txtICUrl.Text;
this.initialContext = new InitialContext(env);
cf = (IConnectionFactory)this.initialContext.Lookup(this.txtConnFactoryName.Text);
if (cf == null)
throw new Exception(String.Format("Failed to find Connection Factory called {0} in initial context at {1}", this.txtConnFactoryName.Text, this.txtICUrl.Text));
// Set properties not provided by InitialContext
cf.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, (int)XMSC.WMQ_CM_CLIENT_UNMANAGED);
return (cf);
}
|
This is the trace from it
Code: |
000015FC 11:38:32.178677 3564.1 : xcsGetEnvironmentString[MQCHLLIB] = 'd:\MQ'
000015FD 11:38:32.178685 3564.1 : ------} xcsGetEnvironmentString (rc=OK)
000015FE 11:38:32.178692 3564.1 : GetEnv[MQCHLLIB] = 'd:\MQ'
000015FF 11:38:32.178700 3564.1 : ------{ xcsFreeMemFn
00001600 11:38:32.178707 3564.1 : component:8 pointer:07091D00
00001601 11:38:32.178715 3564.1 : cbmindex:9
00001602 11:38:32.178723 3564.1 : ------} xcsFreeMemFn (rc=OK)
00001603 11:38:32.178729 3564.1 : ------{ xcsGetMemFn
00001604 11:38:32.178742 3564.1 : component:8 function:72 length:8 options:0 cbmindex:9 *pointer:07091D00
00001605 11:38:32.178750 3564.1 : ------} xcsGetMemFn (rc=OK)
00001606 11:38:32.178756 3564.1 : ------{ xcsGetEnvironmentString
00001607 11:38:32.178764 3564.1 : xcsGetEnvironmentString[MQCHLTAB] = 'AMQCLCHL.TAB'
00001608 11:38:32.178772 3564.1 : ------} xcsGetEnvironmentString (rc=OK)
00001609 11:38:32.178778 3564.1 : GetEnv[MQCHLTAB] = 'AMQCLCHL.TAB'
Good so far, but later...
000018F1 11:38:32.184694 3564.1 RSESS:000001 -----{ reqDuplicateCno
000018F2 11:38:32.184704 3564.1 RSESS:000001 ------{ xcsGetMemFn
000018F3 11:38:32.184714 3564.1 RSESS:000001 component:20 function:860 length:192 options:0 cbmindex:-1 *pointer:0017FBB0
000018F4 11:38:32.184722 3564.1 RSESS:000001 ------} xcsGetMemFn (rc=OK)
000018F5 11:38:32.184730 3564.1 RSESS:000001 Copying CNO (0047E318) v(5) to CNO (0017FBB0)
000018F6 11:38:32.184740 3564.1 RSESS:000001 ------{ reqGetMQCDLen
000018F7 11:38:32.184746 3564.1 RSESS:000001 ------} reqGetMQCDLen (rc=OK)
000018F8 11:38:32.184754 3564.1 RSESS:000001 ------{ xcsGetMemFn
000018F9 11:38:32.184763 3564.1 RSESS:000001 component:20 function:860 length:1864 options:0 cbmindex:1 *pointer:0017E9C0
000018FA 11:38:32.184771 3564.1 RSESS:000001 ------} xcsGetMemFn (rc=OK)
000018FB 11:38:32.184779 3564.1 RSESS:000001 Copying MQCD (0065C298) v(2) to MQCD (0017E9C0)
000018FC 11:38:32.184787 3564.1 RSESS:000001 ------{ xcsGetMemFn
000018FD 11:38:32.184795 3564.1 RSESS:000001 component:20 function:860 length:544 options:0 cbmindex:2 *pointer:0017F208
000018FE 11:38:32.184803 3564.1 RSESS:000001 ------} xcsGetMemFn (rc=OK)
000018FF 11:38:32.184810 3564.1 RSESS:000001 -----} reqDuplicateCno (rc=OK)
00001900 11:38:32.184816 3564.1 RSESS:000001 -----{ cccGetMem
00001901 11:38:32.184822 3564.1 RSESS:000001 ------{ xcsGetMemFn
00001902 11:38:32.184831 3564.1 RSESS:000001 component:20 function:641 length:3240 options:0 cbmindex:-1 *pointer:0709A010
00001903 11:38:32.184839 3564.1 RSESS:000001 ------} xcsGetMemFn (rc=OK)
00001904 11:38:32.184845 3564.1 RSESS:000001 -----} cccGetMem (rc=OK)
00001905 11:38:32.184853 3564.1 RSESS:000001 -----{ ConvertMQCD
00001906 11:38:32.184861 3564.1 RSESS:000001 ------{ reqGetMQCDLen
00001907 11:38:32.184867 3564.1 RSESS:000001 ------} reqGetMQCDLen (rc=OK)
00001908 11:38:32.184873 3564.1 RSESS:000001 ------{ cccGetMem
00001909 11:38:32.184879 3564.1 RSESS:000001 -------{ xcsGetMemFn
0000190A 11:38:32.184888 3564.1 RSESS:000001 component:20 function:294 length:2512 options:0 cbmindex:-1 *pointer:0017D9B8
0000190B 11:38:32.184896 3564.1 RSESS:000001 -------} xcsGetMemFn (rc=OK)
0000190C 11:38:32.184902 3564.1 RSESS:000001 ------} cccGetMem (rc=OK)
0000190D 11:38:32.184912 3564.1 RSESS:000001 ------{ rrxValidateChannel
0000190E 11:38:32.184923 3564.1 RSESS:000001 -------{ rrxError
0000190F 11:38:32.184934 3564.1 RSESS:000001 RetCode = 20009498, rc1 = 0, rc2 = 0, Comment1 = 'ChannelName', Comment2 = '0', Comment3= '', File= 'F:\build\p701_P\src\lib\client\amqrcdua.c', Line= '384'
00001910 11:38:32.184942 3564.1 RSESS:000001 -------}! rrxError (rc=rrcE_INVALID_MQCD)
|
Compare to this from amqsputc
Code: |
RSESS:000001 -----{ reqDuplicateCno
000008C5 11:33:40.824691 7588.1 RSESS:000001 ------{ xcsGetMemFn
000008C6 11:33:40.824700 7588.1 RSESS:000001 component:20 function:860 length:192 options:0 cbmindex:-1 *pointer:004FFD00
000008C7 11:33:40.824708 7588.1 RSESS:000001 ------} xcsGetMemFn (rc=OK)
000008C8 11:33:40.824716 7588.1 RSESS:000001 Copying CNO (0017F8CC) v(1) to CNO (004FFD00)
000008C9 11:33:40.824724 7588.1 RSESS:000001 -----} reqDuplicateCno (rc=OK)
000008CA 11:33:40.824730 7588.1 RSESS:000001 -----{ cccGetMem
000008CB 11:33:40.824738 7588.1 RSESS:000001 ------{ xcsGetMemFn
000008CC 11:33:40.824747 7588.1 RSESS:000001 component:20 function:641 length:3240 options:0 cbmindex:-1 *pointer:004FE2C8
000008CD 11:33:40.824756 7588.1 RSESS:000001 ------} xcsGetMemFn (rc=OK)
000008CE 11:33:40.824761 7588.1 RSESS:000001 -----} cccGetMem (rc=OK)
000008CF 11:33:40.824768 7588.1 RSESS:000001 -----{ xcsCreateThreadMutexSem
000008D0 11:33:40.824776 7588.1 RSESS:000001 -----} xcsCreateThreadMutexSem (rc=OK)
000008D1 11:33:40.824783 7588.1 RSESS:000001 -----{ xcsRequestThreadMutexSem
000008D2 11:33:40.824789 7588.1 RSESS:000001 -----} xcsRequestThreadMutexSem (rc=OK)
000008D3 11:33:40.824797 7588.1 RSESS:000001 -----{ reqFindNameEntry
000008D4 11:33:40.824803 7588.1 RSESS:000001 -----} reqFindNameEntry (rc=OK)
000008D5 11:33:40.824809 7588.1 RSESS:000001 -----{ reqNameListFromCCDT
000008D6 11:33:40.824816 7588.1 RSESS:000001 ------{ cccGetMem
000008D7 11:33:40.824822 7588.1 RSESS:000001 -------{ xcsGetMemFn
000008D8 11:33:40.824830 7588.1 RSESS:000001 component:20 function:720 length:96 options:0 cbmindex:-1 *pointer:004FFDE8
000008D9 11:33:40.824838 7588.1 RSESS:000001 -------} xcsGetMemFn (rc=OK)
000008DA 11:33:40.824844 7588.1 RSESS:000001 ------} cccGetMem (rc=OK)
000008DB 11:33:40.824851 7588.1 RSESS:000001 ------{ rrxOpenChannelDef
000008DC 11:33:40.824857 7588.1 RSESS:000001 -------{ xcsGetEnvironmentString
000008DD 11:33:40.824869 7588.1 RSESS:000001 xcsGetEnvironmentString[MQSERVER] = NULL
000008DE 11:33:40.824877 7588.1 RSESS:000001 -------}! xcsGetEnvironmentString (rc=xecE_E_ENV_VAR_NOT_FOUND)
000008DF 11:33:40.824889 7588.1 RSESS:000001 Using ChannelDefinitionDirectory / MQCHLLIB value of d:\MQ
000008E0 11:33:40.824899 7588.1 RSESS:000001 Using ChannelDefinitionFile / MQCHLTAB value of AMQCLCHL.TAB
|
Here are the connection factory settings as seen by the app.
Code: |
XMSC_ASYNC_EXCEPTIONS : -1
XMSC_WMQ_BROKER_CONTROLQ : SYSTEM.BROKER.CONTROL.QUEUE
XMSC_WMQ_HOST_NAME : <something sensible>
XMSC_WMQ_CONNECTION_TAG : System.Byte[]
XMSC_WMQ_TEMP_Q_PREFIX :
version : 7
XMSC_WMQ_SHARE_CONV_ALLOWED : 1
XMSC_WMQ_CLEANUP_LEVEL : 1
XMSC_CONNECTION_TYPE_NAME : IBM.XMS.Client.WMQ
XMSC_WMQ_USE_CONNECTION_POOLING : true
XMSC_WMQ_TEMPORARY_MODEL : SYSTEM.DEFAULT.MODEL.QUEUE
XMSC_WMQ_RESCAN_INTERVAL : 5000
XMSC_WMQ_STATUS_REFRESH_INTERVAL : 60000
XMSC_WMQ_QMGR_CCSID : 819
XMSC_WMQ_SSL_KEY_RESETCOUNT : 0
XMSC_PASSWORD : ********
XMSC_WMQ_CONNECTION_MODE : 5
XMSC_WMQ_MESSAGE_RETENTION : 1
XMSC_WMQ_SYNCPOINT_ALL_GETS : false
failIfQuiesce : 1
XMSC_WMQ_BROKER_DUR_SUBQ : SYSTEM.JMS.D.SUBSCRIBER.QUEUE
multicast : 0
XMSC_WMQ_SPARSE_SUBSCRIPTIONS : false
XMSC_WMQ_PUB_ACK_INTERVAL : 25
XMSC_WMQ_SSL_FIPS_REQUIRED : false
wildcardFormat : 0
XMSC_WMQ_PROVIDER_VERSION : unspecified
XMSC_WMQ_BROKER_SUBQ : SYSTEM.JMS.ND.SUBSCRIBER.QUEUE
XMSC_WMQ_BROKER_QMGR :
encoding : 546
XMSC_WMQ_QUEUE_MANAGER : <something sensible>
brokerVersion : 0
XMSC_WMQ_MESSAGE_SELECTION : 0
XMSC_WMQ_MAX_BUFFER_SIZE : 1000
XMSC_CONNECTION_TYPE : 1
XMSC_WMQ_CHANNEL :
XMSC_WMQ_CONNECT_OPTIONS : 0
XMSC_WMQ_MAP_NAME_STYLE : True
targetClient : 0
XMSC_WMQ_BROKER_PUBQ_QMGR :
XMSC_WMQ_SUBSCRIPTION_STORE : 1
XMSC_WMQ_CLEANUP_INTERVAL : 3600000
XMSC_WMQ_LOCAL_ADDRESS :
XMSC_ADMIN_OBJECT_TYPE : 20
XMSC_WMQ_POLLING_INTERVAL : 5000
XMSC_WMQ_BROKER_PUBQ : SYSTEM.BROKER.DEFAULT.STREAM
CCSID : 1208
XMSC_WMQ_MSG_BATCH_SIZE : 10
XMSC_WMQ_PORT : 1414
|
Note that XMSC_WMQ_CHANNEL is blank, not 0, but somehow the lower level classes think they are being passed an badly formed MQCD.
I'm using MQ Client version 7.0.1.4
I've hunted through the docs for XMS and the .Net classes and I haven't seen anything that says this shouldn't work.
What am I missing?
David |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Sep 16, 2011 3:59 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Try the latest v 7.0.1.6 I believe there were some fixes in the XMS area since 7.0.1.4  _________________ MQ & Broker admin |
|
Back to top |
|
 |
dbwsi |
Posted: Mon Sep 19, 2011 1:24 am Post subject: |
|
|
Newbie
Joined: 16 Sep 2011 Posts: 6
|
I've upgraded to 7.0.1.6 but I get exactly the same behaviour and same error.
David |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Sep 19, 2011 11:39 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
How exactly are you setting up your connection factory?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
dbwsi |
Posted: Tue Sep 20, 2011 2:31 am Post subject: |
|
|
Newbie
Joined: 16 Sep 2011 Posts: 6
|
fjb_saper wrote: |
How exactly are you setting up your connection factory?  |
I'm just looking it up from the InitialContext. The settings are as you can see in the last code block, ie I have set the queue manager, host, port, connection type, left the channel blank, and everything else is default. I've set the ccdt url but that isn't read from the bindings file.
If I run it in managed connection mode, I get a 2059 (Q_MGR_NOT_AVAILABLE) through apparently this can be caused
"If the client channel fails to connect, perhaps because of an error with the client-connection or the corresponding server-connection channel definitions."
Again, if I specify a channel name, it all works fine so I don't believe there is an issue which the queue manager itself.
David |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Sep 20, 2011 10:03 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
dbwsi wrote: |
fjb_saper wrote: |
How exactly are you setting up your connection factory?  |
I'm just looking it up from the InitialContext. The settings are as you can see in the last code block, ie I have set the queue manager, host, port, connection type, left the channel blank, and everything else is default. I've set the ccdt url but that isn't read from the bindings file.
If I run it in managed connection mode, I get a 2059 (Q_MGR_NOT_AVAILABLE) through apparently this can be caused
"If the client channel fails to connect, perhaps because of an error with the client-connection or the corresponding server-connection channel definitions."
Again, if I specify a channel name, it all works fine so I don't believe there is an issue which the queue manager itself.
David |
Ok ... if you are using a CCDT you should only set the qmgr name as defined in the client channel. Host, channel and port are provided by the CCDT. client manual in the infocenter.
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
dbwsi |
Posted: Tue Sep 20, 2011 12:15 pm Post subject: |
|
|
Newbie
Joined: 16 Sep 2011 Posts: 6
|
fjb_saper wrote: |
Ok ... if you are using a CCDT you should only set the qmgr name as defined in the client channel. Host, channel and port are provided by the CCDT. client manual in the infocenter. |
Makes sense. However MQExplorer won't let me create a ConnectionFactory without a port set. Even if I then edit the file and blank or remove all the port entries, the ConnectionFactory loaded by my app still has Port set to the default 1414 and I get the same error.
David |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Sep 20, 2011 12:23 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
dbwsi wrote: |
fjb_saper wrote: |
Ok ... if you are using a CCDT you should only set the qmgr name as defined in the client channel. Host, channel and port are provided by the CCDT. client manual in the infocenter. |
Makes sense. However MQExplorer won't let me create a ConnectionFactory without a port set. Even if I then edit the file and blank or remove all the port entries, the ConnectionFactory loaded by my app still has Port set to the default 1414 and I get the same error.
David |
Are you sure you are marking the right radio button on MQExplorer that says use CCDT?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
dbwsi |
Posted: Wed Sep 21, 2011 4:21 am Post subject: |
|
|
Newbie
Joined: 16 Sep 2011 Posts: 6
|
Quote: |
Are you sure you are marking the right radio button on MQExplorer that says use CCDT? |
I've done this:
ie set the CCDTURL and left the channel blank.
I see no other radio buttons I can set. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Sep 21, 2011 7:47 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Don't know which version you're looking at...
On my MQE/WMBE I choose:
Add remote qmgr --> use chltable --- fill in qmgr name
Next screen asks for the channel table location... nothing about a channel name...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
dbwsi |
Posted: Mon Sep 26, 2011 12:45 pm Post subject: |
|
|
Newbie
Joined: 16 Sep 2011 Posts: 6
|
We finally solved this mystery, and the cluprit was MQExplorer. By using JMSAdmin we were able to create a .bindings file with the bare minimum of settings (ie no host, port or channel set), and this worked perfectly. |
|
Back to top |
|
 |
|