|   | 
	 
  
    | 
RSS Feed - WebSphere MQ Support
 | 
RSS Feed - Message Broker Support
 |   
 
  
	     | 
	 | 
   
 
  
	|  MQRC CONNECTION_BROKEN | 
	« View previous topic :: View next topic »  | 
   
  
  	
	  
		
		
		  | Author | 
		  Message
		 |  
		
		  | java_ppl | 
		  
		    
			  
				 Posted: Tue Dec 05, 2006 10:44 am    Post subject: MQRC CONNECTION_BROKEN | 
				     | 
			   
			 
		   | 
		 
		
		   Novice
 
 Joined: 22 Sep 2006 Posts: 13
  
  | 
		  
		    
			  
				hi, 
 
I am getting a connection broken error. 
 
 
I have checked queue.isOpen() and queueManager.isConnected ..and both say that the queue is open and q Manager is connected. 
 
 
Yet, when I i try to get a message, it gives me broken connection Exception. 
 
 
...... 
 
 
I have tried to catch the exception and create new queues, and connect to qManager again , in a while loop till the get message succeeds. 
 
 
But the first time the new objects (queues etc) get created, but again when it tries to get the message, it throws Connection broken exception. 
 
And where I catch the exception , it enters code where I have tried to connect afresh. 
 
Here I get a OBJECT IN USE exception 2042. 
 
------------- 
 
 
In the catch block, 
 
I have also tried queue.close() and queManger.disconnect() before trying to establish fresh connection.. [Becoz of the Object in use exception ] but here I get an exception sayin : CONNECTION BROKEN 
 
 
Can anybodyplease help. 
 
 
Thanks. | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | bower5932 | 
		  
		    
			  
				 Posted: Tue Dec 05, 2006 1:01 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		 
		
		    Jedi Knight
 
 Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA 
  | 
		  
		    
			  
				| What version of WMQ are you running? | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | java_ppl | 
		  
		    
			  
				 Posted: Tue Dec 12, 2006 5:13 am    Post subject:  | 
				     | 
			   
			 
		   | 
		 
		
		   Novice
 
 Joined: 22 Sep 2006 Posts: 13
  
  | 
		  
		    
			  
				Hi , 
 
 
we are using
 
 
 NAME:  WebSphere MQ Client for Sun Solaris
 
 VERSION:  5.3.0.5 | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | Vitor | 
		  
		    
			  
				 Posted: Tue Dec 12, 2006 5:40 am    Post subject:  | 
				     | 
			   
			 
		   | 
		 
		
		    Grand High Poobah
 
 Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA 
  | 
		  
		    
			  
				
   
	| java_ppl wrote: | 
   
  
	|  VERSION:  5.3.0.5 | 
   
 
 
 
You might consider applying a more recent CSD...    _________________ Honesty is the best policy.
 
Insanity is the best defence. | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | java_ppl | 
		  
		    
			  
				 Posted: Mon Feb 12, 2007 4:08 am    Post subject:  | 
				     | 
			   
			 
		   | 
		 
		
		   Novice
 
 Joined: 22 Sep 2006 Posts: 13
  
  | 
		  
		    
			  
				I'm now using WMQ6.0 . And the following code: 
 
public static MQMessage getMessage(
 
 
		MQQueueManager queueManager,
 
 
		MQQueue queue,
 
 
		MQGetMessageOptions gmo) {
 
			
 
		File f = new File("/var/gateway/hi/log/hip.ide.int.act.20070212.log");
 
		FileCreator.appendToTextFile(f,"Inside getMessage() Function...\n");
 
 
		MQMessage message = new MQMessage();
 
 
		message.messageId = MQC.MQMI_NONE;
 
 
	
 
		boolean flag=true;
 
		while(flag)
 
	  {
 
	          
 
           if(queueManager.isConnected())
 
           {
 
			FileCreator.appendToTextFile(f,"***QManager Connected***\n");
 
           }
 
           else
 
           {
 
			FileCreator.appendToTextFile(f,"***QManager Disconnected***\n");
 
			
 
			/*if(queue.isOpen())
 
			{
 
				try {
 
				    	queue.close();
 
				    	
 
					} catch (MQException e) {
 
											FileCreator.appendToTextFile(f,"Exception occurred 0!!\n"+e+"\n");
 
				            				}
 
				
 
			} */
 
			
 
           }
 
           
 
		   if(queue.isOpen())
 
		   {
 
				FileCreator.appendToTextFile(f,"***Queue Connected***\n");
 
			
 
			    
 
		   }
 
		   else
 
		   {
 
			   FileCreator.appendToTextFile(f,"***Queue Disconnected***\n");
 
		   }
 
		try {
 
			
 
 
					message.messageId = MQC.MQMI_NONE;
 
 
					message.correlationId = MQC.MQCI_NONE;
 
			
 
			queue.get(message, gmo);
 
			flag=false;
 
			FileCreator.appendToTextFile(f,"***GOT THE STATUS MESSAGE !!!***\n");
 
			
 
		} catch (MQException e) {
 
 
						FileCreator.appendToTextFile(f,"Exception occurred 1!!\n"+e+"\n");
 
		
 
					
 
				//FileCreator.appendToTextFile(f,"***Closing Queue***\n");
 
				
 
			try {
 
				//queue.close();
 
				//FileCreator.appendToTextFile(f,"***Closing QM***\n");
 
				
 
				FileCreator.appendToTextFile(f,""+Config.getQueueManagerName() + "\n"+ queue.name + "\n");
 
				queueManager.disconnect();
 
				FileCreator.appendToTextFile(f,"***Before createWMQObjects()***\n");
 
				MQController.createWMQObjects(Config.getQueueManagerName(),Config.getQueueName());
 
				FileCreator.appendToTextFile(f,"***After createWMQObjects() ***\n");
 
				
 
				}catch(Exception ex)
 
			{
 
				//ex.printStackTrace();
 
				FileCreator.appendToTextFile(f,"Exception occurred 2!!\n"+ex + "\n");
 
				//throw new GatewayException(ex);
 
			}
 
				
 
 
		}
 
 
	   }
 
	  
 
	   return message;
 
		}
 
	
 
 
 
 
The output logged to the filel looks like this: 
 
 
Inside getMessage() Function...
 
***QManager Connected***
 
***Queue Connected***
 
Exception occurred 1!!
 
com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2009
 
BMTSEM1
 
MFM.HUB.EQ_TRD.WBI.HIP.ST
 
***Before createWMQObjects()***
 
***After createWMQObjects() ***
 
***QManager Disconnected***
 
***Queue Connected***
 
Exception occurred 1!!
 
com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2019
 
BMTSEM1
 
MFM.HUB.EQ_TRD.WBI.HIP.ST
 
***Before createWMQObjects()***
 
Exception occurred 2!!
 
com.morleyfm.eai.common.GatewayException: Error when creating WMQ Queue: MFM.HUB.EQ_TRD.WBI.HIP.ST
 
***QManager Disconnected***
 
***Queue Connected***
 
Exception occurred 1!!
 
 
 
and so on.................... 
 
 
I dont understand If Queue Manager and Queue are connected how it throws the disconnected exception (2009). 
 
 
Any idea? 
 
 
Thanks,
 
jp | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | 
		    
		   | 
		 
	   
	 | 
   
 
  
	     | 
	 | 
	Page 1 of 1 | 
   
 
 
 
  
  	
	  
		
		  
 
  | 
		  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
  | 
  		 
	   
	 | 
   
 
  	 | 
	  |