Author |
Message
|
msantos007 |
Posted: Tue Jun 21, 2005 4:44 am Post subject: MQRC 2277 |
|
|
Voyager
Joined: 20 Dec 2004 Posts: 78
|
Does any one can help me?
QCHAR48 QMgrName;
MQHCONN Hconn;
MQLONG CompCode;
MQLONG Reason;
MQCNO ConnectOpts = {MQCNO_DEFAULT};
MQCD ClientConn = {MQCD_CLIENT_CONN_DEFAULT};
MQCHAR48 QMgrName2;
MQHCONN Hconn2;
MQCNO ConnectOpts2= {MQCNO_DEFAULT};
MQCD ClientConn2 = {MQCD_CLIENT_CONN_DEFAULT};
ConnectOpts.Version = MQCNO_VERSION_2;
ConnectOpts.ClientConnPtr = &ClientConn;
ClientConn.ChannelType=MQCHT_SVRCONN;
ClientConn.TransportType = MQXPT_TCP;
ConnectOpts2.Version = MQCNO_VERSION_2;
ConnectOpts2.ClientConnPtr = &ClientConn2;
ClientConn2.TransportType = MQXPT_TCP;
ClientConn2.ChannelType=MQCHT_SVRCONN;
strcpy(QMgrName, "BRMTZC1");
strcpy(QMgrName2, "BRMTZC2");
strcpy(ClientConn.ChannelName,"BRMTZC1");
strcpy(ClientConn.ConnectionName, "192.168.0.137(1414)");
strcpy(ClientConn2.ChannelName,"BRMTZC2");
strcpy(ClientConn2.ConnectionName, "192.168.0.137(1415)");
MQCONNX (QMgrName, &ConnectOpts, &Hconn, &CompCode, &Reason);
if(CompCode != MQCC_OK)
{
printf("\nErro de Conexão com QM %s -> Reason: %d", QMgrName, Reason);
}
else
printf("\nConexão com QM %s OK",QMgrName2 );
//Conectar ao Queue Manager 2
MQCONNX (QMgrName2, &ConnectOpts2, &Hconn2, &CompCode, &Reason);
if(CompCode != MQCC_OK)
{
printf("\nErro de Conexão com QM %s -> Reason: %d", QMgrName2, Reason);
}
else
printf("\nConexão com QM %s OK", QMgrName2);
This is resulting me MQRC 2277 _________________ Maximiliano R. A. Santos
IBM Websphere MQ V6.0 Certified System Administrator
IBM Websphere MQ V5.3 Certified Solution Developer |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Jun 21, 2005 6:00 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Messages wrote: |
2277 X'08E5' MQRC_CD_ERROR
An MQCONNX call was issued to connect to a queue manager, but the MQCD channel definition structure addressed by the ClientConnOffset or ClientConnPtr field in MQCNO contains data that is not valid. Consult the WebSphere MQ error log for more information about the nature of the error.
This reason code occurs in the following environments: AIX, HP-UX, Linux, OS/2, OS/400, Solaris, Windows, plus WebSphere MQ clients connected to these systems.
Corrective action: Ensure that required input fields in the MQCD structure are set correctly.
|
So, double check all of your MQCD fields, and also look in the server error log for more information. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
msantos007 |
Posted: Tue Jun 21, 2005 6:17 am Post subject: |
|
|
Voyager
Joined: 20 Dec 2004 Posts: 78
|
jeff...
what do you mean with 'double check'? _________________ Maximiliano R. A. Santos
IBM Websphere MQ V6.0 Certified System Administrator
IBM Websphere MQ V5.3 Certified Solution Developer |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Jun 21, 2005 6:21 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
msantos007 wrote: |
jeff...
what do you mean with 'double check'? |
I mean "review again", go back to the manuals or sample code you started with and make sure that the fields you are populating are correct. And make sure that you are populating all the fields you need to. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
wschutz |
Posted: Tue Jun 21, 2005 6:29 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
The code looks okay, what about:
Quote: |
Consult the WebSphere MQ error log for more information about the nature of the error.
|
Does the error log say anything interesting? And are you getting the 2277 on BOTH MQCONNX's? _________________ -wayne |
|
Back to top |
|
 |
msantos007 |
Posted: Tue Jun 21, 2005 6:41 am Post subject: |
|
|
Voyager
Joined: 20 Dec 2004 Posts: 78
|
there's no log error at the server log
these are the last messages, 4 hours ago
06/21/2005 04:30:50
AMQ9209: Connection to host 'nb-max (192.168.0.167)' closed.
EXPLANATION:
An error occurred receiving data from 'nb-max (192.168.0.167)' over TCP/IP.
The connection to the remote host has unexpectedly terminated.
ACTION:
Tell the systems administrator.
----- amqccita.c : 2781 -------------------------------------------------------
06/21/2005 04:30:50
AMQ9228: The TCP/IP responder program could not be started.
EXPLANATION:
An attempt was made to start an instance of the responder program, but the
program was rejected.
ACTION:
The failure could be because either the subsystem has not been started (in this
case you should start the subsystem), or there are too many programs waiting
(in this case you should try to start the responder program later). The reason
code was 0.
----- amqrmrsa.c : 461 -------------------------------------------------------- _________________ Maximiliano R. A. Santos
IBM Websphere MQ V6.0 Certified System Administrator
IBM Websphere MQ V5.3 Certified Solution Developer |
|
Back to top |
|
 |
wschutz |
Posted: Tue Jun 21, 2005 7:13 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
You want to look at the error log on the client side, it should be in:
<mq client install directory>\error\amqerr01.log _________________ -wayne |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Jun 21, 2005 7:32 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
wschutz wrote: |
You want to look at the error log on the client side |
Man, not my best week.  _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
msantos007 |
Posted: Tue Jun 21, 2005 8:20 am Post subject: |
|
|
Voyager
Joined: 20 Dec 2004 Posts: 78
|
thanks
I found this ... is there any one who knows
21/6/2005 11:03:07
AMQ9498: The MQCD structure supplied was not valid.
EXPLANATION:
The value of the 'ChannelType' field has the value '7'. This value is invalid
for the operation requested.
ACTION:
Change the parameter and retry the operation.
I changed my code.. copying all functions from amqsccnxc.c
then i started getting RC 2058
and my log says
AMQ9248: The program could not bind to a TCP/IP socket.
EXPLANATION:
The attempt to bind to socket '192.168.0.137(1414)' failed with return code
10049. The failing TCP/IP call was 'bind'. The most likely cause of this
problem is incorrect configuration of the TCP/IP local address or incorrect
start and end port parameters.
ACTION:
Contact the system administrator. If the problem persists contact your IBM
support center.
----- amqccita.c : 1033 ------------------------------------------------------- _________________ Maximiliano R. A. Santos
IBM Websphere MQ V6.0 Certified System Administrator
IBM Websphere MQ V5.3 Certified Solution Developer |
|
Back to top |
|
 |
Nigelg |
Posted: Tue Jun 21, 2005 8:24 am Post subject: |
|
|
Grand Master
Joined: 02 Aug 2004 Posts: 1046
|
Code: |
ClientConn.ChannelType=MQCHT_SVRCONN; |
You had the right type to start with., The channel on the client cannot be a SVRCONN, it has to be a CLNTCONN.
Also, you cannot connect to different qmgrs in the same thread. On Windows, you can connect to a different qmgr in another thread in the same process, but in UNIX you are denied even that simple pleasure. |
|
Back to top |
|
 |
msantos007 |
Posted: Tue Jun 21, 2005 8:32 am Post subject: |
|
|
Voyager
Joined: 20 Dec 2004 Posts: 78
|
No good...
I need to connect to 2 different svrconn channels...
the guys i'm connecting weren't happy when i said i needed
a clntconn channel... and i must do it.. using only one w2k box _________________ Maximiliano R. A. Santos
IBM Websphere MQ V6.0 Certified System Administrator
IBM Websphere MQ V5.3 Certified Solution Developer |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Jun 21, 2005 8:44 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
msantos007 wrote: |
No good...
I need to connect to 2 different svrconn channels...
the guys i'm connecting weren't happy when i said i needed
a clntconn channel... and i must do it.. using only one w2k box |
You need to set it to a clntconn on your side. It's a svrconn on the qmgr side.
What you are doing with your code is defining the clntconn.
And I think Nigel is confused about the threading limitations for clients.
Clients, Chapter 8, Section On the WebSphere MQ Client Subsection Using the MQCNO structure on an MQCONNX call wrote: |
Using the MQCNO structure on an MQCONNX call
A WebSphere MQ client application can use the connect options structure, MQCNO, on an MQCONNX call to reference a channel definition structure, MQCD, that contains the definition of a client-connection channel.
In this way, the client application can specify the ChannelName, TransportType, and ConnectionName attributes of a channel at run time, and this enables the client application to connect to multiple server queue managers simultaneously.
|
My emphasis.
Also,
Clients, Chapter 7, Connecting to a Queue Manager using the MQCONN call, subsection Scope of MQCONN or MQCONNX wrote: |
If your application is running as a client, it may connect to more than one queue manager within a thread. |
_________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
wschutz |
Posted: Tue Jun 21, 2005 8:59 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
Does this work:
set MQSERVER=BRMTZC1/TCP/192.168.0.137(1414)
amqsputc SYSTEM.DEFAULT.LOCAL.QUEUE BRMTZC1
?? If it works, then the problem is in your client code, if it does not
work, then the problem is with the server config. Try it. _________________ -wayne |
|
Back to top |
|
 |
msantos007 |
Posted: Tue Jun 21, 2005 9:58 am Post subject: |
|
|
Voyager
Joined: 20 Dec 2004 Posts: 78
|
yes amqsputc is fine
my problem is with this #$!!#!@#!@ code _________________ Maximiliano R. A. Santos
IBM Websphere MQ V6.0 Certified System Administrator
IBM Websphere MQ V5.3 Certified Solution Developer |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Jun 21, 2005 10:06 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
msantos007 wrote: |
yes amqsputc is fine
my problem is with this #$!!#!@#!@ code |
I think, as long as you do what Nigel said, you should be okay.
Or at least get a different ReasonCode.
Again, what your code is doing is creating the clntconn side of the channel pair - and connecting to the svrconn on the server. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|