Author |
Message
|
smcgowan |
Posted: Tue Jul 11, 2006 11:51 pm Post subject: CompCode = 2, ReasonCode = 2059...Help! |
|
|
Novice
Joined: 11 Jul 2006 Posts: 14
|
Hi there,
I have a simple VB app that uses the MQPUT call to place messages on a queue. I'm using VB Express 2005 with WebSphere MQ 6.0 Server (on the same machine). I wish to write to a queue with my program. The VB program I'm using is actually the sample 'amqsputb.vbp' project that comes with WebSphere MQ 6.0 (if you know it).
Anyway, I'm getting Completion Code = 2 and Reason Code = 2059. I understand that 2059 means it can't connect with the Queue Manager but I've check MQ and the QM seems to be running fine. Does anybody have any other ideas?? Need help! I've also checked the case sensitive spelling.
Cheers,
Sean |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jul 12, 2006 12:25 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
I'm more VB6, but are you using client or server libraries? If client, are you sure the connection parameters are set up correctly (MQSERVER / Client table)?
I'm assuming here it's the connection rather than the put that's returning the code. Let me know if that's a false assumption. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
PieterV |
Posted: Wed Jul 12, 2006 12:33 am Post subject: |
|
|
Disciple
Joined: 04 Jan 2006 Posts: 164 Location: Belgium
|
post the line where you get the error.
i think i must look something like:
Code: |
qmgr = new New MQQueueManager(...)
|
between the braces you should have 3 arguments:
1) Queue Manager Name
2) Channel you use to connect to the queue manager
3) location(port): eg. localhost(1414) |
|
Back to top |
|
 |
smcgowan |
Posted: Wed Jul 12, 2006 2:12 am Post subject: Problem Solved |
|
|
Novice
Joined: 11 Jul 2006 Posts: 14
|
I got it all sorted thanks a million. The project I was running had been upgraded from VB 6.0 to .NET. So I just got the .NET classes and used them from scratch it works fine now. Thanks for all your replies. My advice: stay away from upgrading projects from 6.0 to .NET if you can!!!! Nightmare icon_wink.gif
Sean |
|
Back to top |
|
 |
smcgowan |
Posted: Wed Jul 12, 2006 5:07 am Post subject: NEED HELP AGAIN!! |
|
|
Novice
Joined: 11 Jul 2006 Posts: 14
|
Hi,
I'm working again with the VB 6.0 version of the MQPUT program. Sorry to confuse people I'm still getting the same problem as I originally posted in this thread. I'm getting Completion Code 2 and Reason Code 2059. It won't connect with the Queue Manager which I have checked and is running. Can somebody help me?
Cheers,
Sean |
|
Back to top |
|
 |
smcgowan |
Posted: Wed Jul 12, 2006 5:14 am Post subject: |
|
|
Novice
Joined: 11 Jul 2006 Posts: 14
|
It's not a VB error, it's an MQ connection error. The ComCode and Reason are returned from the MQCONN and shown in a list box:
MQCONN "", gHcon, CompCode, Reason
cboAPIRC.AddItem "MQCONN: CompCode = " + Str(CompCode) + ", Reason Code = " + Str(Reason), 0 |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jul 12, 2006 5:49 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
And I repeat my advice. 2059 is a connection failure. If you're linked with the client libraries check the settings. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
smcgowan |
Posted: Wed Jul 12, 2006 5:59 am Post subject: |
|
|
Novice
Joined: 11 Jul 2006 Posts: 14
|
Excuess my ignorance but what exactly are these settings? I have a Queue Manager up and running in WebSphere MQ 6.0. Within this, I have a local queue called TEST.Q up and running. VB 6.0 and MQ 6.0 are on the same PC. When I run the VB program on somebody elses machine pointing at a queue on their MQ installation, it works fine. It seems to be specific to my MQ settings.
Sean |
|
Back to top |
|
 |
smcgowan |
Posted: Wed Jul 12, 2006 6:01 am Post subject: |
|
|
Novice
Joined: 11 Jul 2006 Posts: 14
|
Excuse my spelling  |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jul 12, 2006 6:08 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Quite right - it is specific to the settings on your machine. These are the MQ client settings identifiying the queue manager(s) the applications are to connect to. If the "someone else's machine" has the client set for their queue manager, this would allow your program to function as you describe.
They're described more completly and more accurately than I can achieve in the "Using Clients" manual or online infocentre entry.
A short-term quick fix would be to relink the application with the server libraries, but this would limit it to being on the same machine as the queue manager it's using.
And I'll excuse your spelling if you excuse mine.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
smcgowan |
Posted: Wed Jul 12, 2006 6:18 am Post subject: |
|
|
Novice
Joined: 11 Jul 2006 Posts: 14
|
Just to clear something up, can you confirm what exactly you mean by client and server. My understanding of it is this:
WebSphere Client: An application that uses the WebSphere MQ API to connect with an MQ server somewhere, be it on another machine.
WebSphere Server: An application that connects to WebSphere MQ Server on the same machine. THIS IS WHAT I'M DOING, or try to do  |
|
Back to top |
|
 |
smcgowan |
Posted: Wed Jul 12, 2006 6:26 am Post subject: |
|
|
Novice
Joined: 11 Jul 2006 Posts: 14
|
The comments of the code contained this:
'* ================================================ *'
'* Run-time error: CompCode = 2, Reason = 2059 *'
'* ================================================ *'
'* PROBLEM: *'
'* o MQRC_Q_MGR_NOT_AVAILABLE: Queue Manager not available *'
'* SOLUTION: *'
'* o Check MQSERVER environment variable: *'
'* Under Windows NT/2000 *'
'* Click: Start->Settings->Control Panel *'
'* Double Click: System *'
'* Click tab for ENVIRONMENT *'
'* Add/Change System variable: *'
'* MQSERVER=channel_name/tcp/tcp_name *'
'* Under Windows 95/98 *'
'* Edit AUTOEXEC.BAT file *'
'* Add the line: *'
'* SET MQSERVER=channel_name/tcp/tcp_name *'
'* Note: channel_name is case sensitive *'
'* o For Windows 95/98 Check: *'
'* \MQM\MQS.INI has an entry: *'
'* AllQueueManagers: *'
'* DefaultPrefix=D:\mqm *'
'* D: is disk where MQClient is installed *'
'* If necessary, rerun REGISTER.EXE from D:\MQM directory *'
'* The above MQS.INI is not relevant for NT/2000. *'
'* o Verify that the server can be pinged: *'
'* ping tcp_name *'
'* o Verify C samples work: *'
'* \MQM\TOOLS\SAMPLES\C\BIN\AMQSPUTC.EXE *'
'* \MQM\TOOLS\SAMPLES\C\BIN\AMQSGETC.EXE *'
'* *'
'**********************************************************************'
I set the MQSERVER variable but that didn't help. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jul 12, 2006 6:27 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Sort of - a client can connect to any queue manager anywhere on any machine including the one it's running on. (A server is limited, as you correctly point out, to the local queue manager).
There are good and sufficient reasons why you might want to client onto a local machine, which are spelled out in the reference I gave you. One obvious one is an application that's developed with the benefit of a local queue manager (like on my laptop) but will run in prod on a Win server connected to a queue manager on a Unix box. Exe runs unmodified and we say yay!
As I said previously, if your app will only ever run against a local queue manager link it with the server libraries and have done.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jul 12, 2006 6:29 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
smcgowan wrote: |
I set the MQSERVER variable but that didn't help. |
What did you set it to? And was it in scope for your app? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
smcgowan |
Posted: Wed Jul 12, 2006 6:41 am Post subject: |
|
|
Novice
Joined: 11 Jul 2006 Posts: 14
|
I wasn't very clear on it. As I said before, I'm a beginner at this. I set it as:
MQSERVER = TO.QM_lorentz/tcp/lorentz
TO.QM_lorentz is a channel that I set up in MQ Explorer but I don't understand why I need this?? I just want to send to a local queue, not across computers.
tcp - I didn't know what to put here so I left it the way it was. Is this the port number??
omarz - the name of the machine I'm working on |
|
Back to top |
|
 |
|