|  | 
 
  
    | RSS Feed - WebSphere MQ Support | RSS Feed - Message Broker Support |  
 
  
	|    |  |  
  
	| Newbie: Problems Connecting To Remote Queue | « View previous topic :: View next topic » |  
  	| 
		
		
		  | Author | Message |  
		  | coolbeans | 
			  
				|  Posted: Tue Aug 10, 2004 3:16 am    Post subject: Newbie: Problems Connecting To Remote Queue |   |  |  
		  |  Novice
 
 
 Joined: 16 Jul 2004Posts: 20
 Location: London, UK
 
 | 
			  
				| Hi. I have an application: 
 
 
   
	| Code: |  
	| try
 {
 boolean isRemote = true;
 
 if(isRemote)
 {
 MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY,//Set TCP/IP or server
 MQC.TRANSPORT_MQSERIES);//Connection
 
 InetAddress inet_address = null;
 
 try
 {
 inet_address = InetAddress.getByName(/* my ip address */);
 }
 catch ( UnknownHostException e )
 {
 e.printStackTrace();
 }
 
 MQEnvironment.hostname = inet_address.getHostName();
 
 MQEnvironment.channel = "WAS.JMS.SVRCONN";
 
 MQEnvironment.port = 8082;
 
 // helps with debugging
 MQEnvironment.enableTracing(2);
 }
 
 MQQueueManager qMgr = new MQQueueManager(/* queue manager name */);
 
 return qMgr;
 }
 catch(MQException ex)
 {
 ex.printStackTrace();
 }
 
 |  
 When I run locally (i.e. isRemote set to false) then it works fine and I can put messages on and take off the queue fine. I need to be able to connect to a remote queue server, although at the moment, during development, I am runing both this client application and the MQ server on my machine.
 I have been looking at this problem for some time but have still not been able to solve it. I have checked the listener port number in the MQ Services GUI, and I have checked the queue manager name and the channel name in MQ Explorer. And the ip address/host name is definatly correct. So either I have made a mistake somewhere or there is something I am missing?
 Can anyone please help?
 
 I'm running win XP.
 |  |  
		  | Back to top |  |  
		  |  |  
		  | coolbeans | 
			  
				|  Posted: Tue Aug 10, 2004 3:20 am    Post subject: |   |  |  
		  |  Novice
 
 
 Joined: 16 Jul 2004Posts: 20
 Location: London, UK
 
 | 
			  
				| P.s. The error I get is that it times out when it tries to create the socket connection and it throws:
 
 com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2059
 
 which is: "Queue manager not available for connection."
 |  |  
		  | Back to top |  |  
		  |  |  
		  | vennela | 
			  
				|  Posted: Tue Aug 10, 2004 5:22 am    Post subject: |   |  |  
		  |  Jedi Knight
 
 
 Joined: 11 Aug 2002Posts: 4055
 Location: Hyderabad, India
 
 | 
			  
				| When you run in client mode: Is your listener running for that queue manager?
 If YES
 Is it running on the port 8082 (that is what you have specified in your program)
 |  |  
		  | Back to top |  |  
		  |  |  
		  | coolbeans | 
			  
				|  Posted: Tue Aug 10, 2004 5:27 am    Post subject: |   |  |  
		  |  Novice
 
 
 Joined: 16 Jul 2004Posts: 20
 Location: London, UK
 
 | 
			  
				| Yes. In the MQ Services GUI, under the queue manager, the listener service status is "running". In the properties for that listener, the port number is 8082, with the protocol set to TCP. |  |  
		  | Back to top |  |  
		  |  |  
		  | bower5932 | 
			  
				|  Posted: Tue Aug 10, 2004 6:56 am    Post subject: |   |  |  
		  |  Jedi Knight
 
 
 Joined: 27 Aug 2001Posts: 3023
 Location: Dallas, TX, USA
 
 | 
			  
				| I'd suggest that you try running the amqsputc sample with the MQSERVER environment variable. 
 set MQSERVER=WAS.JMS.SVRCONN/tcp/hostname(8082)
 amqsputc SYSTEM.DEFAULT.LOCAL.QUEUE your.qmgr.name
 
 This will get any potential coding problems out of the way and let you look at what might be configuration problems.
 |  |  
		  | Back to top |  |  
		  |  |  
		  | coolbeans | 
			  
				|  Posted: Wed Aug 11, 2004 1:05 am    Post subject: |   |  |  
		  |  Novice
 
 
 Joined: 16 Jul 2004Posts: 20
 Location: London, UK
 
 | 
			  
				| Thanks. I got it working now. |  |  
		  | 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
 
 |  |  |  |