ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ API Support » CompCode = 2, ReasonCode = 2059...Help!

Post new topic  Reply to topic Goto page 1, 2  Next
 CompCode = 2, ReasonCode = 2059...Help! « View previous topic :: View next topic » 
Author Message
smcgowan
PostPosted: Tue Jul 11, 2006 11:51 pm    Post subject: CompCode = 2, ReasonCode = 2059...Help! Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Wed Jul 12, 2006 12:25 am    Post subject: Reply with quote

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
View user's profile Send private message
PieterV
PostPosted: Wed Jul 12, 2006 12:33 am    Post subject: Reply with quote

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
View user's profile Send private message
smcgowan
PostPosted: Wed Jul 12, 2006 2:12 am    Post subject: Problem Solved Reply with quote

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
View user's profile Send private message
smcgowan
PostPosted: Wed Jul 12, 2006 5:07 am    Post subject: NEED HELP AGAIN!! Reply with quote

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
View user's profile Send private message
smcgowan
PostPosted: Wed Jul 12, 2006 5:14 am    Post subject: Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Wed Jul 12, 2006 5:49 am    Post subject: Reply with quote

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
View user's profile Send private message
smcgowan
PostPosted: Wed Jul 12, 2006 5:59 am    Post subject: Reply with quote

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
View user's profile Send private message
smcgowan
PostPosted: Wed Jul 12, 2006 6:01 am    Post subject: Reply with quote

Novice

Joined: 11 Jul 2006
Posts: 14

Excuse my spelling
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Jul 12, 2006 6:08 am    Post subject: Reply with quote

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
View user's profile Send private message
smcgowan
PostPosted: Wed Jul 12, 2006 6:18 am    Post subject: Reply with quote

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
View user's profile Send private message
smcgowan
PostPosted: Wed Jul 12, 2006 6:26 am    Post subject: Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Wed Jul 12, 2006 6:27 am    Post subject: Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Wed Jul 12, 2006 6:29 am    Post subject: Reply with quote

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
View user's profile Send private message
smcgowan
PostPosted: Wed Jul 12, 2006 6:41 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » IBM MQ API Support » CompCode = 2, ReasonCode = 2059...Help!
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.