Author |
Message
|
gopalsamant |
Posted: Sun Oct 03, 2004 9:59 pm Post subject: mq error code 2380 |
|
|
Novice
Joined: 24 Sep 2004 Posts: 17
|
hi, i am getting mq2380 error code when i try to communicate, what could be the reason. |
|
Back to top |
|
 |
siliconfish |
Posted: Sun Oct 03, 2004 10:03 pm Post subject: |
|
|
 Master
Joined: 12 Aug 2002 Posts: 203 Location: USA
|
try "mqrc 2380" and look for the error info in the documentation.
Check the error logs for more information. |
|
Back to top |
|
 |
gopalsamant |
Posted: Sun Oct 03, 2004 10:14 pm Post subject: |
|
|
Novice
Joined: 24 Sep 2004 Posts: 17
|
Could not find any such error |
|
Back to top |
|
 |
kirani |
Posted: Sun Oct 03, 2004 10:32 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
All MQ error codes and their error descriptions can be found in Messages manual for WMQ.
Quote: |
2380: MQRC_SCO_ERROR
On an MQCONNX call, the MQSCO structure is not valid for one of the following reasons:
. The StrucId field is not MQSCO_STRUC_ID.
. The Version field is not MQSCO_VERSION_1.
This reason code occurs in the following environments: AIX, HP-UX, Linux, Solaris, Windows.
Corrective action: Correct the definition of the MQSCO structure.
|
_________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
gopalsamant |
Posted: Mon Oct 04, 2004 2:05 am Post subject: |
|
|
Novice
Joined: 24 Sep 2004 Posts: 17
|
Thabks for the Infor Kiran, Can you please provide me with some link to download this manual. |
|
Back to top |
|
 |
JasonE |
Posted: Mon Oct 04, 2004 3:00 am Post subject: |
|
|
Grand Master
Joined: 03 Nov 2003 Posts: 1220 Location: Hursley
|
Er... Top of this page, Documentation -> Messages  |
|
Back to top |
|
 |
gopalsamant |
Posted: Tue Oct 05, 2004 12:34 am Post subject: |
|
|
Novice
Joined: 24 Sep 2004 Posts: 17
|
Guys, Here is my code in the C client program. I am trying to enable SSL and i am getting error 2380. Please help.
MQSCO sco = {MQSCO_DEFAULT}; /*SSL Configuration Options */
MQCNO cno = {MQCNO_DEFAULT}; /*Connect Options for SSL */
/* Intializing the parameters of structure for SSL */
strcpy(sco.StrucId,MQSCO_STRUC_ID) ;
sco.Version = MQSCO_VERSION_1;
strcpy(sco.KeyRepository, "/cq1/bin/ssl/keyStore");
sco.KeyRepository[21]='\0';
strcpy(cno.StrucId, MQCNO_STRUC_ID) ;
cno.Version = MQCNO_VERSION_4 ;
cno.Options = MQCNO_NONE ;
cno.SSLConfigPtr = &sco ;
cno.SSLConfigOffset = 0 ; |
|
Back to top |
|
 |
JasonE |
Posted: Tue Oct 05, 2004 12:58 am Post subject: |
|
|
Grand Master
Joined: 03 Nov 2003 Posts: 1220 Location: Hursley
|
strcpy(sco.StrucId,MQSCO_STRUC_ID) ;
A bit dodgy - since its a 4 byte field, filled with a 4 byte constant, you should use strncpy(sco.StrucId,MQSCO_STRUC_ID, 4);
sco.KeyRepository[21]='\0';
Not required, as you have used strcpy
Cant quite see why you are getting the error though. There's only 2 places you can get this r/c, one is if the eyecatcher is wrong, the other is if the SCO version field is not 1. Try running it under a debugger and see what the MQSCO control block looks like before the call (fiurst 8 bytes). |
|
Back to top |
|
 |
gopalsamant |
Posted: Tue Oct 05, 2004 6:15 pm Post subject: |
|
|
Novice
Joined: 24 Sep 2004 Posts: 17
|
Still the same. what do you mean eyecatcher. how do i check whether it is wrong or not. |
|
Back to top |
|
 |
JasonE |
Posted: Wed Oct 06, 2004 1:06 am Post subject: |
|
|
Grand Master
Joined: 03 Nov 2003 Posts: 1220 Location: Hursley
|
if you look at a hex dump of the first 8 chars, they should be SCO<space> <version> (layout depends on endianness of the structure, but it is usually:
53 43 4F 20 01 00 00 00 or 53 43 4F 20 00 00 00 01 on ascii platforms
You also need to ensure you are passing in the right pointer to it from the cno structure - it looks ok in the code, but you can check under a debugger (Confirm a 4 byte alignment as well)
If you can narrow the program down to the smallest possible (ie just the failing mqconnx) and post it in here, I'll give it a try! (on windows). |
|
Back to top |
|
 |
gopalsamant |
Posted: Thu Oct 07, 2004 1:51 am Post subject: |
|
|
Novice
Joined: 24 Sep 2004 Posts: 17
|
Hi All, thanks for all the help.
Now i am getting 2381 error. not sure what it is. could not find any document that explains that, please help |
|
Back to top |
|
 |
JasonE |
Posted: Thu Oct 07, 2004 2:25 am Post subject: |
|
|
Grand Master
Joined: 03 Nov 2003 Posts: 1220 Location: Hursley
|
MQRC 2381
2381 0x0000094d MQRC_KEY_REPOSITORY_ERROR |
|
Back to top |
|
 |
gopalsamant |
Posted: Thu Oct 07, 2004 6:40 pm Post subject: |
|
|
Novice
Joined: 24 Sep 2004 Posts: 17
|
Thanks again, here is what i have. i have a file keystore at /cq1/bin/ssl and here is my code for key repository. it is still giving me 2381 error. i have tried changing the path to /cq1/bin/ssl/keystore but still the same error. Below is my code......... please help.
strncpy(sco.StrucId,MQSCO_STRUC_ID,4) ;
sco.Version = MQSCO_VERSION_1;
strcpy(sco.KeyRepository, "/cq1/bin/ssl");
strcpy(sco.CryptoHardware," ");
strcat(qcd.ChannelName,ls_channel);
strcat(qcd.ConnectionName,ls_host);
strcat(qcd.ConnectionName,"(");
strcat(qcd.ConnectionName,ls_port);
strcat(qcd.ConnectionName,")");
strcat(qcd.SSLCipherSpec,"RC4_MD5_US");
strncpy(cno.StrucId, MQCNO_STRUC_ID,4) ;
cno.Version = MQCNO_VERSION_4 ;
cno.Options = MQCNO_NONE ;
cno.ClientConnPtr = &qcd ;
strcpy(cno.ConnTag,MQCT_NONE) ;
cno.SSLConfigPtr = &sco ;
MQCONNX (QMName, /* queue manager */
&cno, /* Connection Options */
&Hcon, /* connection handle */
&CompCode, /* completion code */
&CReason); /* reason code */ |
|
Back to top |
|
 |
JasonE |
Posted: Fri Oct 08, 2004 2:03 am Post subject: |
|
|
Grand Master
Joined: 03 Nov 2003 Posts: 1220 Location: Hursley
|
Modified code, works fine here:
Code: |
#include <cmqc.h>
#include <cmqxc.h>
#include <stdio.h>
void main() {
MQCD qcd = { MQCD_DEFAULT };
MQSCO sco = { MQSCO_DEFAULT };
MQCNO cno = { MQCNO_DEFAULT };
MQCHAR48 QMName;
MQHCONN Hcon;
MQLONG CompCode;
MQLONG CReason;
strcpy(QMName, "QM");
strncpy(sco.StrucId,MQSCO_STRUC_ID,4) ;
sco.Version = MQSCO_VERSION_1;
strcpy(sco.KeyRepository, "C:\\MQ\\testprgs\\ssl\\key");
strcpy(sco.CryptoHardware," ");
[color=blue] qcd.ChannelType = MQCHT_CLNTCONN;
qcd.TransportType = MQXPT_TCP;[/color]
strcat(qcd.ChannelName,"SSL.ADMIN.SVRCONN");
strcat(qcd.ConnectionName,"127.0.0.1");
strcat(qcd.ConnectionName,"(");
strcat(qcd.ConnectionName,"1414");
strcat(qcd.ConnectionName,")");
strcat(qcd.SSLCipherSpec,"RC4_MD5_US");
strncpy(cno.StrucId, MQCNO_STRUC_ID,4) ;
cno.Version = MQCNO_VERSION_4 ;
cno.Options = MQCNO_NONE ;
cno.ClientConnPtr = &qcd ;
strcpy(cno.ConnTag,MQCT_NONE) ;
cno.SSLConfigPtr = &sco ;
MQCONNX (QMName, /* queue manager */
&cno, /* Connection Options */
&Hcon, /* connection handle */
&CompCode, /* completion code */
&CReason); /* reason code */
printf("cc:%d, rc:%d\n", CompCode, CReason);
}
|
2381 (KEY_REPOSITORY_ERROR) implies the path to the key repository is incorrect - are you sure you have supplied it correct (where exactly is the key repository you have set up called - your pgm supplied "/cq1/bin/ssl" |
|
Back to top |
|
 |
gopalsamant |
Posted: Fri Oct 08, 2004 2:08 am Post subject: |
|
|
Novice
Joined: 24 Sep 2004 Posts: 17
|
Thanks for all the help guys. It is working now. |
|
Back to top |
|
 |
|