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 » IBM MQ Java / JMS » Newbie: Problems Connecting To Remote Queue

Post new topic  Reply to topic
 Newbie: Problems Connecting To Remote Queue « View previous topic :: View next topic » 
Author Message
coolbeans
PostPosted: Tue Aug 10, 2004 3:16 am    Post subject: Newbie: Problems Connecting To Remote Queue Reply with quote

Novice

Joined: 16 Jul 2004
Posts: 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
View user's profile Send private message
coolbeans
PostPosted: Tue Aug 10, 2004 3:20 am    Post subject: Reply with quote

Novice

Joined: 16 Jul 2004
Posts: 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
View user's profile Send private message
vennela
PostPosted: Tue Aug 10, 2004 5:22 am    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 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
View user's profile Send private message Send e-mail Visit poster's website
coolbeans
PostPosted: Tue Aug 10, 2004 5:27 am    Post subject: Reply with quote

Novice

Joined: 16 Jul 2004
Posts: 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
View user's profile Send private message
bower5932
PostPosted: Tue Aug 10, 2004 6:56 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
coolbeans
PostPosted: Wed Aug 11, 2004 1:05 am    Post subject: Reply with quote

Novice

Joined: 16 Jul 2004
Posts: 20
Location: London, UK

Thanks. I got it working now.
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 » IBM MQ Java / JMS » Newbie: Problems Connecting To Remote Queue
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.