| Author | 
		  Message
		 | 
		
		  | scar | 
		  
		    
			  
				 Posted: Tue Dec 22, 2009 4:46 am    Post subject: Unable to resolve MQEnvironment.hostname = "localhost&q | 
				     | 
			   
			 
		   | 
		
		
		   Centurion
 
 Joined: 23 Jun 2004 Posts: 145
  
  | 
		  
		    
			  
				MQ 6, AIX 5.2, java 1.3.1
 
 
 
When I set the hostname variable to localhost 
 
MQEnvironment.hostname = "localhost";
 
I am getting the following error when creating the QMGR object
 
mqQueueManager = new MQQueueManager(strQueueManager);
 
 
MQJE001: An MQException occurred: Completion Code 2, Reason 2059 
 
MQJE011: Socket connection attempt refused 
 
MQJE001: An MQException occurred: Completion Code 2, Reason 2059 
 
MQJE011: Socket connection attempt refused 
 
com.ibm.mq.MQException: MQJE001: An MQException occurred: Completion Code 2, Reason 2059 
 
MQJE011: Socket connection attempt refused 
 
at com.ibm.mq.MQManagedConnectionJ11.<init>(MQManagedConnectionJ11.java:268) 
 
at com.ibm.mq.MQClientManagedConnectionFactoryJ11._createManagedConnection(MQClientManagedConnectionFactoryJ11.java:318) 
 
at com.ibm.mq.MQClientManagedConnectionFactoryJ11.createManagedConnection(MQClientManagedConnectionFactoryJ11.java:338) 
 
at com.ibm.mq.StoredManagedConnection.<init>(StoredManagedConnection.java:84) 
 
at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConnectionManager.java:168) 
 
at com.ibm.mq.MQQueueManagerFactory.obtainBaseMQQueueManager(MQQueueManagerFactory.java:774) 
 
at com.ibm.mq.MQQueueManagerFactory.procure(MQQueueManagerFactory.java:690) 
 
at com.ibm.mq.MQQueueManagerFactory.constructQueueManager(MQQueueManagerFactory.java:646) 
 
at com.ibm.mq.MQQueueManagerFactory.createQueueManager(MQQueueManagerFactory.java:153) 
 
at com.ibm.mq.MQQueueManager.<init>(MQQueueManager.java:471) 
 
at AcctCode1.main(AcctCode1.java:437) 
 
 
when I replace it with IP or the actual host name
 
MQEnvironment.hostname = "xxx.xxx.xx.xx";
 
Its working fine.
 
 
Any help is appreciated. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | fschofer | 
		  
		    
			  
				 Posted: Tue Dec 22, 2009 5:16 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Knight
 
 Joined: 02 Jul 2001 Posts: 524 Location: Mainz, Germany 
  | 
		  
		    
			  
				Hi,
 
are both localhost and the host name resolving to the same ip if you ping them ?
 
 
Greetings
 
Frank | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | scar | 
		  
		    
			  
				 Posted: Tue Dec 22, 2009 5:45 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Centurion
 
 Joined: 23 Jun 2004 Posts: 145
  
  | 
		  
		    
			  
				| When I ping localhost and hostname , I am getting different Ips, in the sense,Ping localhost goes to the loopback and ping <hostname> is working. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | PhilBlake | 
		  
		    
			  
				 Posted: Wed Dec 23, 2009 7:09 am    Post subject: Re: Unable to resolve MQEnvironment.hostname = "localho | 
				     | 
			   
			 
		   | 
		
		
		    Acolyte
 
 Joined: 25 Oct 2005 Posts: 64
  
  | 
		  
		    
			  
				
   
	| scar wrote: | 
   
  
	| MQ 6, AIX 5.2, java 1.3.1 | 
   
 
 
 
Any reason why you're using such an old level of java ? MQ v6 comes with java 1.4. I'd get the latest. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mqjeff | 
		  
		    
			  
				 Posted: Wed Dec 23, 2009 7:29 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Grand Master
 
 Joined: 25 Jun 2008 Posts: 17447
  
  | 
		  
		    
			  
				| Is the MQ listener running on the loopback address?  I.e. can you "telnet localhost <listener port>"? | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | scar | 
		  
		    
			  
				 Posted: Wed Dec 23, 2009 7:40 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Centurion
 
 Joined: 23 Jun 2004 Posts: 145
  
  | 
		  
		    
			  
				Its not connecting
 
 
/home/mqm/log $ telnet localhost 1414
 
Trying...
 
telnet: connect: A remote host refused an attempted connect operation. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | fjb_saper | 
		  
		    
			  
				 Posted: Wed Dec 23, 2009 11:46 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand High Poobah
 
 Joined: 18 Nov 2003 Posts: 20768 Location: LI,NY 
  | 
		  
		    
			  
				
   
	| scar wrote: | 
   
  
	Its not connecting
 
 
/home/mqm/log $ telnet localhost 1414
 
Trying...
 
telnet: connect: A remote host refused an attempted connect operation. | 
   
 
 
Firewall rules!   _________________ MQ & Broker admin | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mqjeff | 
		  
		    
			  
				 Posted: Wed Dec 23, 2009 11:49 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Grand Master
 
 Joined: 25 Jun 2008 Posts: 17447
  
  | 
		  
		    
			  
				
   
	| fjb_saper wrote: | 
   
  
	
   
	| scar wrote: | 
   
  
	Its not connecting
 
 
/home/mqm/log $ telnet localhost 1414
 
Trying...
 
telnet: connect: A remote host refused an attempted connect operation. | 
   
 
 
Firewall rules!   | 
   
 
 
 
Or the listener is configured on a specific IP and not on *. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | fjb_saper | 
		  
		    
			  
				 Posted: Wed Dec 23, 2009 11:53 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand High Poobah
 
 Joined: 18 Nov 2003 Posts: 20768 Location: LI,NY 
  | 
		  
		    
			  
				True. I just figured that he knew the correct port...     _________________ MQ & Broker admin | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | scar | 
		  
		    
			  
				 Posted: Wed Dec 23, 2009 12:24 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Centurion
 
 Joined: 23 Jun 2004 Posts: 145
  
  | 
		  
		    
			  
				When I start the listener as follows
 
runmqlsr -m QMGR -t TCP -p 1414 -i <hostname> &
 
I am able to connect to the QMGR using rfhutil and explorer.
 
 
 
 
When I start the listener as follows
 
runmqlsr -m QMGR -t TCP -p 1414 -i localhost &
 
I am not able to connect to the QMGR using rfhutil and explorer. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | manicminer | 
		  
		    
			  
				 Posted: Thu Dec 24, 2009 1:18 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Disciple
 
 Joined: 11 Jul 2007 Posts: 177
  
  | 
		  
		    
			  
				
   
	| scar wrote: | 
   
  
	When I start the listener as follows
 
runmqlsr -m QMGR -t TCP -p 1414 -i <hostname> &
 
I am able to connect to the QMGR using rfhutil and explorer.
 
 
 
 
When I start the listener as follows
 
runmqlsr -m QMGR -t TCP -p 1414 -i localhost &
 
I am not able to connect to the QMGR using rfhutil and explorer. | 
   
 
 
 
That's great. I'm assuming from this statement that you no longer have a problem?
 
 
edit: And I assume you've read the manual, and understand what the parameters are and how they change the behaviour of runmqlsr? Also it would be worth doing some background reading on TCP/IP if you don't don't understand why your two scenario's above give the results that they do. _________________ Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |