ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General IBM MQ Support » Unable to resolve MQEnvironment.hostname = "localhost&q

Post new topic  Reply to topic
 Unable to resolve MQEnvironment.hostname = "localhost&q « View previous topic :: View next topic » 
Author Message
scar
PostPosted: Tue Dec 22, 2009 4:46 am    Post subject: Unable to resolve MQEnvironment.hostname = "localhost&q Reply with quote

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
View user's profile Send private message
fschofer
PostPosted: Tue Dec 22, 2009 5:16 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
scar
PostPosted: Tue Dec 22, 2009 5:45 am    Post subject: Reply with quote

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
View user's profile Send private message
PhilBlake
PostPosted: Wed Dec 23, 2009 7:09 am    Post subject: Re: Unable to resolve MQEnvironment.hostname = "localho Reply with quote

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
View user's profile Send private message
mqjeff
PostPosted: Wed Dec 23, 2009 7:29 am    Post subject: Reply with quote

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
View user's profile Send private message
scar
PostPosted: Wed Dec 23, 2009 7:40 am    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Wed Dec 23, 2009 11:46 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
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
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Wed Dec 23, 2009 11:49 am    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Wed Dec 23, 2009 11:53 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

True. I just figured that he knew the correct port...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
scar
PostPosted: Wed Dec 23, 2009 12:24 pm    Post subject: Reply with quote

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
View user's profile Send private message
manicminer
PostPosted: Thu Dec 24, 2009 1:18 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » Unable to resolve MQEnvironment.hostname = "localhost&q
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.