cdemir
asked on
MQJE036: Queue manager rejected connection attempt
hi,
We are trying to use more than one QueueManager. we can read mq data from "test1" successfully, but when trying to set QMNG "test2", we are getting "MQJE036: Queue manager rejected connection attempt" error.
p.s : when executing this code for one QueueManager, we don't have any problem.
//Main Class :
//------------------------ ---------- ---------- ---------- ---------- --
String[] QueueManager = null;
QueueManager[1]= "test1";
QueueManager[2]= "test2";
cnt = 3;
k = 1;
while (k < cnt)
{
MQQueueManager QMNG = null ;
MQRead _MQRead = new MQRead();
QMNG = new MQQueueManager(QueueManage r[k]);
_MQRead.setQMgr(QMNG);
_MQRead.Read();
_MQRead.finalize();
System.gc();
k++;
}
//MQRead finalize method :
//------------------------ ---------- ---------- ---------- ---------- --
public void finalize(){
try {
if (conn != null) conn.close();
queue.close();
QMNG.disconnect();
} catch (Exception e) {
logging("MQRead.finalize:" +e.getMess age(),"E") ;
}
}
//------------------------ ---------- ---------- ---------- ---------- --
We are trying to use more than one QueueManager. we can read mq data from "test1" successfully, but when trying to set QMNG "test2", we are getting "MQJE036: Queue manager rejected connection attempt" error.
p.s : when executing this code for one QueueManager, we don't have any problem.
//Main Class :
//------------------------
String[] QueueManager = null;
QueueManager[1]= "test1";
QueueManager[2]= "test2";
cnt = 3;
k = 1;
while (k < cnt)
{
MQQueueManager QMNG = null ;
MQRead _MQRead = new MQRead();
QMNG = new MQQueueManager(QueueManage
_MQRead.setQMgr(QMNG);
_MQRead.Read();
_MQRead.finalize();
System.gc();
k++;
}
//MQRead finalize method :
//------------------------
public void finalize(){
try {
if (conn != null) conn.close();
queue.close();
QMNG.disconnect();
} catch (Exception e) {
logging("MQRead.finalize:"
}
}
//------------------------
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
hi peter,
when we try this code, we cannot set "test2" to QMNG. so, we can connect "test1" but not "test2". and we get this error : "MQJE001: An MQException occurred: Completion Code 2, Reason 2058".
//------------------------ ---------- ---------- ---------- ---------- ---------- ---------- -----
String[] QueueManager = null;
QueueManager[1]= "test1";
QueueManager[2]= "test2";
cnt = 3;
k = 1;
while (k < cnt)
{
MQQueueManager QMNG = null ;
QMNG = new MQQueueManager(QueueManage r[k]);
System.gc();
k++;
}
//------------------------ ---------- ---------- ---------- ---------- ---------- ---------- -----
when we try this code, we cannot set "test2" to QMNG. so, we can connect "test1" but not "test2". and we get this error : "MQJE001: An MQException occurred: Completion Code 2, Reason 2058".
//------------------------
String[] QueueManager = null;
QueueManager[1]= "test1";
QueueManager[2]= "test2";
cnt = 3;
k = 1;
while (k < cnt)
{
MQQueueManager QMNG = null ;
QMNG = new MQQueueManager(QueueManage
System.gc();
k++;
}
//------------------------
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Btw. your code shouldn't even get to the 'new MQQueueManager' line: the variable QueueManager is null.
ASKER
>>Can you post the output from dspmq (on Windows run it in cmd, on Unix it's under /usr/mqm/bin or /opt/mqm/bin).
Q's status is running. (all of them)
>>I suspect that the second qm doesn't exist.
second qm exist. as i mentinoed above, "when executing this code for one QueueManager, we don't have any problem". btw, when we execute this code on Windows (QMs are created the Unix box), we can connect all QMs and we don't have any problem. but, when running this code on Unix box; for one QM, no problem but for second QM it gives error.
>>Are you doing anything with MQEnvironment before creating the MQQueueManager objects?
No.
may be it can help you more :
MQJE001: An MQException occurred: Completion Code 2, Reason 2058
MQJE036: Queue manager rejected connection attempt
com.ibm.mq.MQException: MQJE001: An MQException occurred: Completion Code 2, Reason 2058
MQJE036: Queue manager rejected connection attempt
at com.ibm.mq.MQManagedConnec tionJ11.<i nit>(MQMan agedConnec tionJ11.ja va:242)
at com.ibm.mq.MQClientManaged Connection FactoryJ11 ._createMa nagedConne ction(MQCl ientManage dConnectio nFactoryJ1 1.java:276 )
at com.ibm.mq.MQClientManaged Connection FactoryJ11 .createMan agedConnec tion(MQCli entManaged Connection FactoryJ11 .java:296)
at com.ibm.mq.StoredManagedCo nnection.< init>(Stor edManagedC onnection. java:80)
at com.ibm.mq.MQSimpleConnect ionManager .allocateC onnection( MQSimpleCo nnectionMa nager.java :171)
at com.ibm.mq.MQQueueManager. obtainBase MQQueueMan ager(MQQue ueManager. java:754)
at com.ibm.mq.MQQueueManager. construct( MQQueueMan ager.java: 688)
at com.ibm.mq.MQQueueManager. <init>(MQQ ueueManage r.java:417 )
at MyMqPck.MQRead.selectQMgr( MQRead.jav a:214)
at MyMqPck.MqMain.main(MqMain .java:103)
Caused by: com.ibm.mqservices.MQInter nalExcepti on: MQJE001: An MQException occurred: Completion Code 2, Reason 2058
MQJE036: Queue manager rejected connection attempt
at com.ibm.mq.MQInternalCommu nications. connectToQ ueueManage r(MQIntern alCommunic ations.jav a:2613)
at com.ibm.mq.MQInternalCommu nications. <init>(MQI nternalCom munication s.java:569 )
at com.ibm.mq.MQSESSIONClient .MQCONN(MQ SESSIONCli ent.java:1 316)
at com.ibm.mq.MQManagedConnec tionJ11.<i nit>(MQMan agedConnec tionJ11.ja va:218)
... 9 more
Q's status is running. (all of them)
>>I suspect that the second qm doesn't exist.
second qm exist. as i mentinoed above, "when executing this code for one QueueManager, we don't have any problem". btw, when we execute this code on Windows (QMs are created the Unix box), we can connect all QMs and we don't have any problem. but, when running this code on Unix box; for one QM, no problem but for second QM it gives error.
>>Are you doing anything with MQEnvironment before creating the MQQueueManager objects?
No.
may be it can help you more :
MQJE001: An MQException occurred: Completion Code 2, Reason 2058
MQJE036: Queue manager rejected connection attempt
com.ibm.mq.MQException: MQJE001: An MQException occurred: Completion Code 2, Reason 2058
MQJE036: Queue manager rejected connection attempt
at com.ibm.mq.MQManagedConnec
at com.ibm.mq.MQClientManaged
at com.ibm.mq.MQClientManaged
at com.ibm.mq.StoredManagedCo
at com.ibm.mq.MQSimpleConnect
at com.ibm.mq.MQQueueManager.
at com.ibm.mq.MQQueueManager.
at com.ibm.mq.MQQueueManager.
at MyMqPck.MQRead.selectQMgr(
at MyMqPck.MqMain.main(MqMain
Caused by: com.ibm.mqservices.MQInter
MQJE036: Queue manager rejected connection attempt
at com.ibm.mq.MQInternalCommu
at com.ibm.mq.MQInternalCommu
at com.ibm.mq.MQSESSIONClient
at com.ibm.mq.MQManagedConnec
... 9 more
To recap:
1. connecting to both qms works when you connect from Windows to Unix
2. when connecting from Unix you cannot connect to the second qm at all
Is that correct?
Are you using bindings mode on Unix?
If so: are you running your program as a user who is a member of the mqm group?
1. connecting to both qms works when you connect from Windows to Unix
2. when connecting from Unix you cannot connect to the second qm at all
Is that correct?
Are you using bindings mode on Unix?
If so: are you running your program as a user who is a member of the mqm group?
ASKER
hi mglxxx,
yes it is correct but we noticed that MQenvirement settings were wrong and we solved the problem.
mglxxx and pkwan, thanks for your help.
yes it is correct but we noticed that MQenvirement settings were wrong and we solved the problem.
mglxxx and pkwan, thanks for your help.
That's good new. You should post a message in the Community Support section to get your points refunded.
ASKER
MQJE001: An MQException occurred: Completion Code 2, Reason 2058
2. Can you connect to "test2" successfully without connecting to "test1"?
yes. when we try for one "QueueManager", we always connect.
3. Will the exception also be thrown if the sequence is reversed?
yes.