| Author | Message | 
		
		  | dhanaraj | 
			  
				|  Posted: Wed Jan 28, 2009 1:11 pm    Post subject: MQJE001: An MQException occurred: Completion Code 2, Reason |   |  | 
		
		  |  Voyager
 
 
 Joined: 10 Aug 2004Posts: 92
 
 
 | 
			  
				| HI i am getting the following error while i am trying to connect to the QMGR. Sub Main:Create QMgr|QM.NDPRT.P|Message: MQJE001: An MQException occurred: Completion Code 2, Reason 2058
 MQJE036: Queue manager rejected connection attempt
 
 
 QMGR and program are running on the same server.
 
 Please help some ideas what sould i check.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | Vitor | 
			  
				|  Posted: Wed Jan 28, 2009 1:21 pm    Post subject: Re: MQJE001: An MQException occurred: Completion Code 2, Rea |   |  | 
		
		  |  Grand High Poobah
 
 
 Joined: 11 Nov 2005Posts: 26093
 Location: Texas, USA
 
 | 
			  
				| 
   
	| dhanaraj wrote: |  
	| Sub Main:Create QMgr|QM.NDPRT.P|Message: MQJE001: An MQException occurred: Completion Code 2, Reason 2058 MQJE036: Queue manager rejected connection attempt
 
 |  
 2058 is an odd reason code for a rejected connection. But if it's really 2058 make sure the queue manager name you quote in your code is spelt correctly and is in the same case as the queue manager you're attempting to connect to.
 _________________
 Honesty is the best policy.
 Insanity is the best defence.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | dhanaraj | 
			  
				|  Posted: Wed Jan 28, 2009 1:32 pm    Post subject: |   |  | 
		
		  |  Voyager
 
 
 Joined: 10 Aug 2004Posts: 92
 
 
 | 
			  
				| thanks for ur response. I verified the QMGR name is same. QM.NDPRT.P |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | Vitor | 
			  
				|  Posted: Wed Jan 28, 2009 1:36 pm    Post subject: |   |  | 
		
		  |  Grand High Poobah
 
 
 Joined: 11 Nov 2005Posts: 26093
 Location: Texas, USA
 
 | 
			  
				| Well I'm still surprised you got a 2058 with a rejected connection. I'd have expected a 2059 or a 2019. 
 But 2058 is  MQRC_Q_MGR_NAME_ERROR so something's wrong either with the name or where the application is looking for that queue manager (because it's not finding one of that name where it's looking).
 
 You say it's on the same server as the queue manager. Client or binding connection?
 _________________
 Honesty is the best policy.
 Insanity is the best defence.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | dhanaraj | 
			  
				|  Posted: Wed Jan 28, 2009 1:49 pm    Post subject: |   |  | 
		
		  |  Voyager
 
 
 Joined: 10 Aug 2004Posts: 92
 
 
 | 
			  
				| if it is same server means its in bind mode right?  That is also i am not able figure it out. I am giving the arguments QMGR name and STRMODE in the process definition. 
 here is program
 public static void main(String args[]) throws Exception, MQException
 {
 
 //Initialize variables
 strMode = args[0].toUpperCase();
 strQMgr = args[1].toUpperCase();
 //Validate Inputs
 ValidateInputs(strMode, strQMgr);
 
 //Set queue names
 qManager = "QM." + strQMgr + "." + strMode;
 
 if(strMode == "P") //Production
 {
 qGetName = strQMgr + ".RT.IN.Q";
 qPutName = strQMgr + ".RT";
 qBackout = "QM." + strQMgr + ".BACKOUT.Q";
 qUnRecFormat = "QM." + strQMgr + ".UNRECOGNIZED.FORMAT.REJECT.Q";
 MQEnvironment.hostname = "maverick.noridian.com";
 MQEnvironment.port     = 1450;
 MQEnvironment.channel  = "THOR.2." + strQMgr;
 }
 else //Test
 {
 qGetName = strQMgr + ".RT.T.IN.Q";
 qPutName = strQMgr + ".RT.T";
 qBackout = "QM." + strQMgr + ".T.BACKOUT.Q";
 qUnRecFormat = "QM." + strQMgr + ".T.UNRECOGNIZED.FORMAT.REJECT.Q";
 MQEnvironment.hostname = "goose.noridian.com";
 MQEnvironment.port     = 1450;
 MQEnvironment.channel  = "THOR.2." + strQMgr + ".T";
 }
 
 //create a connection to the queue manager
 try
 {
 qMgr = new MQQueueManager(qManager);
 }
 catch(MQException mqex)
 {
 compCode = mqex.completionCode;
 strErrors = "TranIdentify.class|Sub Main:Create QMgr|" + qManager + "|Message: " + mqex.getMessage();
 LogError(strErrors);
 System.exit(0);
 }
 
 MainLoop();
 }
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | Vitor | 
			  
				|  Posted: Wed Jan 28, 2009 1:53 pm    Post subject: |   |  | 
		
		  |  Grand High Poobah
 
 
 Joined: 11 Nov 2005Posts: 26093
 Location: Texas, USA
 
 | 
			  
				| 
   
	| dhanaraj wrote: |  
	| if it is same server means its in bind mode right? |  
 Wrong. The code is setting up client connection parameters in the MQEvironment structure. This is far more in keeping with a "connection refused" error, which is most likely a firewall or other network component  locking you out.
 
 Still would expect a 2059, but there you go.
 _________________
 Honesty is the best policy.
 Insanity is the best defence.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | mqjeff | 
			  
				|  Posted: Wed Jan 28, 2009 2:22 pm    Post subject: |   |  | 
		
		  | Grand Master
 
 
 Joined: 25 Jun 2008Posts: 17447
 
 
 | 
			  
				| 
   
	| Vitor wrote: |  
	| Still would expect a 2059, but there you go. |  
 I'd only expect a 2059 if the qmgr at the other end of the client connection had the same name as the variable qManager held.
 
 If they were different, I'd expect a 2058, which appears to be occurring.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | PeterPotkay | 
			  
				|  Posted: Wed Jan 28, 2009 3:43 pm    Post subject: |   |  | 
		
		  |  Poobah
 
 
 Joined: 15 May 2001Posts: 7723
 
 
 | 
			  
				| whatever this ends up being: 
 
   
	| Code: |  
	| qManager = "QM." + strQMgr + "." + strMode; |  is not the name of the QM listening on port 1450 on goose.noridian.com.
 
 Try this from the command line of the machine that has MQ Client installed, the machine you are running this code from:
 
 
 
   
	| Code: |  
	| amqscnxc -c YourChannelNameHere -x goose.noridian.com(1450) |  
 Post the command you run and the results. If it works, its your code. If it fails, get this IBM MQ sample program working first before you go back to your code.
 _________________
 Peter Potkay
 Keep Calm and MQ On
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  |  |