Author |
Message
|
Bahan |
Posted: Wed Jun 13, 2007 12:30 am Post subject: [C][MQSERIES 6.0] Reason Code 2058 |
|
|
Apprentice
Joined: 16 Jul 2006 Posts: 47 Location: France
|
Hi everyone.
I 'm encountering a problem with MQseries 6.0.
Here is the (very simple) code in C language :
Code: |
char szMqQManager[20] = "MyQueueManager";
MQHCONN lConnexion = 0L;
MQLONG lCodeRetourMQ = 0L;
MQLONG lCodeDiagMQconn = 0L;
/*
* -- --------------------------------------------------------------
* CONNECTION TO QUEUE MANAGER
* -- --------------------------------------------------------------
*/
MQCONN(szMqQManager, &lConnexion, &lCodeRetourMQ, &lCodeDiagMQconn);
if(lCodeDiagMQconn != 0L)
{
/* Pb during connection to the queue manager */
logFunction(error_message);
}
else
{
/* Connection ok */
logFunction(ok_message);
} |
This code is from a program which is on the computer where the MQ server is installed.
I have always the same error when I try like this to connect to this Queue Manager :
Code: |
Failure in connection to QM [MyQueueManager] : (MQSERIES Reason Code : [2058]) |
The user with which I try to connect to this Queue Manager is MyUser. He has the following authorizations on the Queue Manager :
Code: |
inq
set
connect
altusr
dlt
chg
dsp
setid
setall
|
The explanations of this error code are the following in the MQseries documentation :
Code: |
2058 X’080A’ MQRC_Q_MGR_NAME_ERROR
On an MQCONN or MQCONNX call, the value specified for the QMgrName parameter is not valid or not known. This reason also occurs if the parameter pointer is not valid. (It is not always possible to detect parameter pointers that are not valid; if not detected, unpredictable
results occur.)
On z/OS for CICS applications, this reason can occur on any call if the original connect specified an incorrect or unrecognized name.
This reason code can also occur if a WebSphere MQ client application attempts to connect to a queue manager within a WebSphere MQ-client queue-manager group (see the QMgrName parameter of MQCONN), and either :
v Queue-manager groups are not supported.
v There is no queue-manager group with the specified name.
Corrective action: Use an all-blank name if possible, or verify that the name used is valid. |
But the name of my Queue Manager is valid because with the MQseries administrator user, I can connect to this Queue Manager.
I don't understand where is the problem and so I was wondering if someone could help me ^_^.
Thank you.
Bahan _________________ Close the world.||.txen eht nepO |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jun 13, 2007 12:56 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Is the C code linked with the client or the server libraries?
If it's linked with the client, has the client connection been properly configured? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Bahan |
Posted: Wed Jun 13, 2007 1:01 am Post subject: |
|
|
Apprentice
Joined: 16 Jul 2006 Posts: 47 Location: France
|
Quote: |
Is the C code linked with the client or the server libraries? |
The C code is compiled in another computer (with the same MQseries version) and with the library available in /usr/mqm/lib64.
OS : AIX 5.3
MQSERIES : 6.0
Bahan _________________ Close the world.||.txen eht nepO |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jun 13, 2007 1:44 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Bahan wrote: |
The C code is compiled in another computer (with the same MQseries version) and with the library available in /usr/mqm/lib64.
|
Yes - with the client library in that folder, or the server library in that folder? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Bahan |
Posted: Wed Jun 13, 2007 3:12 am Post subject: |
|
|
Apprentice
Joined: 16 Jul 2006 Posts: 47 Location: France
|
Quote: |
Yes - with the client library in that folder, or the server library in that folder? |
Hum, I think this is the server libraries which are in /usr/mqm/lib64
How can I be sure of this ?
Bahan _________________ Close the world.||.txen eht nepO |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jun 13, 2007 3:39 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Bahan wrote: |
Quote: |
Yes - with the client library in that folder, or the server library in that folder? |
Hum, I think this is the server libraries which are in /usr/mqm/lib64
How can I be sure of this ?
Bahan |
It's the library named in the link include when the application is linked.
If it is linked server side as you say, then the queue manager name in the connect call is not the same name as the queue manager on the machine the application is running on. This is the only cause of a 2058 in this scenario. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Bahan |
Posted: Wed Jun 13, 2007 4:09 am Post subject: |
|
|
Apprentice
Joined: 16 Jul 2006 Posts: 47 Location: France
|
Quote: |
It's the library named in the link include when the application is linked.
If it is linked server side as you say, then the queue manager name in the connect call is not the same name as the queue manager on the machine the application is running on. This is the only cause of a 2058 in this scenario. |
Hum...
By library, you're meaning cmqc.h that I need to use MQseries functions in C ?
When I compile my program on my test machine, I used the path /usr/include (maybe the default path) to go look for cmqc.h.
Do you think the error 2058 is coming from this ?
Bahan _________________ Close the world.||.txen eht nepO |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Jun 13, 2007 4:15 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
No, the 2058 is not coming from that.
If you aren't sure about the difference between a library and an include...
The 2058 is coming from the fact that either you're specifying the qmgr name wrong, or you're connecting to the wrong queue manager, or you're binding against the server library and trying to run the app on a client install.
Go back to the Application Programming Guide. Review the section on Building your app on AIX. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jun 13, 2007 4:48 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Bahan wrote: |
When I compile my program on my test machine, I used the path /usr/include (maybe the default path) to go look for cmqc.h.
|
We've established in an earlier post the libraries are in /usr/mqm/lib64
And when I talk about client & server libraries, I do mean libraries not includes.
Review the documentation about building an application, and not just the MQ stuff for points this elementary!  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Bahan |
Posted: Wed Jun 13, 2007 5:14 am Post subject: |
|
|
Apprentice
Joined: 16 Jul 2006 Posts: 47 Location: France
|
Here is the error log I found in the following file : /var/mqm/errors/AMQERR01.LOG
Quote: |
06/13/07 14:56:50 - Process(323638.1) User(MyUser) Program(MyProg.bin)
AMQ9518: File '/var/mqm/AMQCLCHL.TAB' not found.
EXPLANATION:
The program requires that the file '/var/mqm/AMQCLCHL.TAB' is present and available.
ACTION:
This may be caused by invalid values for the optional environment variables MQCHLLIB, MQCHLTAB or MQDATA. If these variables are valid or not set then record the name of the file and tell the systems administrator who must ensure that file '/var/mqm/AMQCLCHL.TAB' is available to the program.
----- amqrcdfa.c : 470 --------------------------------------------------------
|
I found this file here : /var/mqm/qmgrs/MyQueueManager/@ipcc/AMQCLCHL.TAB
Bahan _________________ Close the world.||.txen eht nepO
Last edited by Bahan on Wed Jun 13, 2007 5:28 am; edited 2 times in total |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jun 13, 2007 5:22 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Bahan wrote: |
Here is the erro log in the following file : /var/mqm/errors/AMQERR01.LOG
Quote: |
06/13/07 14:56:50 - Process(323638.1) User(MyUser) Program(MyProg.bin)
AMQ9518: File '/var/mqm/AMQCLCHL.TAB' not found.
EXPLANATION:
The program requires that the file '/var/mqm/AMQCLCHL.TAB' is present and available.
ACTION:
This may be caused by invalid values for the optional environment variables MQCHLLIB, MQCHLTAB or MQDATA. If these variables are valid or not set then record the name of the file and tell the systems administrator who must ensure that file '/var/mqm/AMQCLCHL.TAB' is available to the program.
----- amqrcdfa.c : 470 --------------------------------------------------------
|
But I'm not using any TAB file normally...
Bahan |
So, as I suspected, you have linked it client side and have failed to set up a client connection.
Set up the connection and this will remove the 2058. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Jun 13, 2007 5:28 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Answer the following questions:
1) Is the queue manager you want to connect to on the SAME machine or a DIFFERENT machine than the one you want to run your program on?
2) Based on the answer to #1, what type of MQ connection do you need your program to establish - a "server" connection or a "client" connection?
3) Based on the answer to #2, you need to compile and link your application against different LIBRARIES. Which library did you compile and link your application against?
4) Based on the answer to #2, you may also have to do additional setup in the environment to allow your program to know where the queue manager is. Did you do that setup?
5) Based on the answer to #4, can you re-read the error message you just posted and figure out what's missing?
Also, again. If you don't know the difference between an INCLUDE and a LIBRARY, then you're trying to do too many things that are outside your experience. You should stop what you're doing, and go back and do some remedial learning on a) writing and building C programs, b) the section in the Application Programming Guide that tells you how to compile and build MQ applications. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Bahan |
Posted: Wed Jun 13, 2007 5:30 am Post subject: |
|
|
Apprentice
Joined: 16 Jul 2006 Posts: 47 Location: France
|
Quote: |
So, as I suspected, you have linked it client side and have failed to set up a client connection.
Set up the connection and this will remove the 2058. |
Ok, I will look for the documentation about how to set up the connection.
This is something to do before to use MQCONN ?
Bahan _________________ Close the world.||.txen eht nepO |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jun 13, 2007 5:46 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Bahan wrote: |
Ok, I will look for the documentation about how to set up the connection.
|
I'd start looking in the Clients manual
Bahan wrote: |
This is something to do before to use MQCONN ?
|
As per the log message, it's an administrative task to create a TAB file.
The manual describes alternative methods of creating a client connection. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Bahan |
Posted: Wed Jun 13, 2007 6:33 am Post subject: |
|
|
Apprentice
Joined: 16 Jul 2006 Posts: 47 Location: France
|
In fact it looks enough complex to me.
It speaks about some kind of channels like MQI channels or message channels.
If I have both my client and my server on the same computer, if I have to connect to this server by using C, what I have to do ? ^_^
1. I create the Queue Manager
2. I start the Queue Manager
3. I define some queues and a channel SVRCONN
4. I set authorizations
5. I try to connect with MQCONN in a C program
What have I forgotten ?
Sorry but I'm so confused now that I don't know what I can do anymore...
I have two others computers on which there is a MQSERIES client and I can connect without any problems to this Queue Manager. If I want to connect from the same computer to the Queue Manager, it doesnt' work... I don't understand
Bahan _________________ Close the world.||.txen eht nepO
Last edited by Bahan on Wed Jun 13, 2007 7:24 am; edited 1 time in total |
|
Back to top |
|
 |
|