Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MQ Reason code 2059

Status
Not open for further replies.

gavinlow

IS-IT--Management
Oct 14, 2002
12
SG
I have a server box housing my app server and MQ server. All the MQ resources defined and able to put message using the sample programs (and receive it in destination queue). MQ listener at port 51414.

However, from my application, I always get reason code 2059 (cannot connect to qmgr).

Need help.

A side question - when making connection to qmgr in app, how does it know which port to direct the connection to?

Thanks.
 
You say mq listener port is 51414. But is the listener actually running??? Make sure it is.

2059 is pretty vauge error message and could happen because of variety of reasons. Most common of course is that you dont have your listener running. Others being, you dont have authorizations to access the qm or qm objects or write to a file etc. CCSID differences etc. Also make sure you have defined MQSERVER variable.

Ans to your other ques. If you are writing the app in any other language other than java, you have to set the environment variable. In java of course you have the option of coding this.

Good luck.



Cheers
KK
 
I have this way to set the port in java for example :

public MQConn(String Hostname, String QManager, String Channel, String QLocal, int LocalOptions, String QRemote, int RemoteOptions) throws MQException {

super();

if (qMgr == null) {
//variables used for connection
hostname = Hostname;
qManager = QManager;
channel = Channel;
ScolaLocal = QLocal;
ScolaRemota = QRemote;
ITimeOut = -1;
openOptionsLocal = LocalOptions;
openOptionsRemote = RemoteOptions;

// DEFINE ENVIRONMENT
MQEnvironment.hostname = hostname; MQEnvironment.channel = channel;
// HERE I DEFINE THE PORT :
MQEnvironment.port = 2270;
// HERE I DEFINE THE USER :
MQEnvironment.userID = "root";

qMgr = new MQQueueManager(qManager);
// ACCESS TO READ TO A QUEUE
if (ScolaLocal != null) {
colaLocal = qMgr.accessQueue(ScolaLocal, openOptionsLocal, null, null, "root");
lectura = 1;
}
// ACCESS TO WRITE TO A QUEUE
if (ScolaRemota != null) {
colaRemota = qMgr.accessQueue(ScolaRemota, openOptionsRemote, null, null, "root");
escritura = 1;
}
}
}

Good luck.

LRH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top