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 » Bindings mode works but can’t connect using client mode

Post new topic  Reply to topic
 Bindings mode works but can’t connect using client mode « View previous topic :: View next topic » 
Author Message
roliv
PostPosted: Fri Oct 26, 2001 12:54 pm    Post subject: Reply with quote

Novice

Joined: 26 Aug 2001
Posts: 11

Hi,

I have a very simple and small sample program (it uses the MQSeries classes for Java) that connects to a Queue Manager, puts a message on a queue, and then gets that same message from the same queue. Well, this program works fine if I am using bindings mode. However, if I try to connect using client mode, I get the following exception when trying to create an instance of the MQQueueManager class:

MQ Exception - com.ibm.mq.MQException: Completion Code 2, Reason 2059

The only difference between the bindings code and the client code is the following three lines of code (these are executed as soon as the program starts in client mode):

MQEnvironment.hostname = "ROLIV";
MQEnvironment.channel = "SERVER_CONN";
MQEnvironment.port = 1414;

ROLIV is the name of my machine, SERVER_CONN is the name of the server connection channel that I created in the queue manager, and 1414 is the default port for MQSeries clients. As far as I know, I only need a server connection channel in the queue manager to connect using client mode. Does any one have an idea of what could be wrong? Am I missing anything? Thanks!
Back to top
View user's profile Send private message
kolban
PostPosted: Fri Oct 26, 2001 2:19 pm    Post subject: Reply with quote

Grand Master

Joined: 22 May 2001
Posts: 1072
Location: Fort Worth, TX, USA

Is the MQSeries channel listener running for THAT queue manager and listening on port 1414? What platform is the application and queue manager running upon? Any error messages logged in the MQSeries AMQERR01.LOG files?
Back to top
View user's profile Send private message
UpkarSharma
PostPosted: Sun Oct 28, 2001 8:44 pm    Post subject: Reply with quote

Apprentice

Joined: 15 Aug 2001
Posts: 27
Location: Mumbai

Please make sure that Port 1414 is the same to which your application is trying to connect. Also add this line in to your code ... after environment properties...

MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES);

Try to run the code now .... is u still have problem, I will send u the whole code for u ...


Back to top
View user's profile Send private message Send e-mail MSN Messenger
roliv
PostPosted: Mon Oct 29, 2001 10:17 am    Post subject: Reply with quote

Novice

Joined: 26 Aug 2001
Posts: 11

Thanks for your replies.

kolban - Yes, the server connection channel is defined under the right queue manager and it is has been started. The Queue Manager is running on Windows 2000. I just checked the AMQERR01.LOG file and no errors have been written into this file. The Queue Manager should be listening to PORT 1414 since I didn't specify any other port when I created it. I was trying to double check this using the MQSeries Explorer window. I right-clicked on the Queue Manager and then selected the "properties" option but I don't see any field for the port number. How can I verify it is actually listening to port 1414?

UpkarSharma - My application is indeed trying to connect to port 1414 and I do have the following line in my code after environment properties:

MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES);

If you send me your code, I will take a look at it and see if there is anything that I am missing. However, my guess is that it has to be something in my environment that is wrong.
Thanks for your help!
Back to top
View user's profile Send private message
bower5932
PostPosted: Mon Oct 29, 2001 2:51 pm    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

You might try using the amqsputc sample with the MQServer set:

SET MQSERVER=SERVER_CONN/TCP/ROLIV
amqsputc qname qmgrname

This will remove the java from the equation. You can also use:

SET MQSERVER=SYSTEM.DEF.SVRCONN/TCP/ROLIV
amqsputc qname qmgrname

This will use the default channel.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
kolban
PostPosted: Mon Oct 29, 2001 4:09 pm    Post subject: Reply with quote

Grand Master

Joined: 22 May 2001
Posts: 1072
Location: Fort Worth, TX, USA

Try

netstat -an

And look and see if something is listening on TCP port 1414. Believe it will show up as

TCP 0.0.0.0.1414 LISTENING
Back to top
View user's profile Send private message
roliv
PostPosted: Mon Oct 29, 2001 5:40 pm    Post subject: Reply with quote

Novice

Joined: 26 Aug 2001
Posts: 11

Thanks for your help! My Queue Manager was not listening to port 1414. I used netstat -an to check this and no application was listening on that port. I created another Queue Manager and this time I made sure to tell it to listen to port 1414. After doing this, I changed the Queue Manager name in my code to new one and it connected!!

So now I have another question: If I have already created a Queue Manager and that queue manager is not listening to any port, is there a way from the MQSeries Explorer console to tell this Queue Manager to listen to any TCP/IP port?

Back to top
View user's profile Send private message
kolban
PostPosted: Mon Oct 29, 2001 8:07 pm    Post subject: Reply with quote

Grand Master

Joined: 22 May 2001
Posts: 1072
Location: Fort Worth, TX, USA

Not from MQExplorer but yes from the GUI MQSeries Services. Open that up, select the queue manager, go to the listener attributes (right click, select properties) and then go to the parameters tab - hey presto a port number.
Back to top
View user's profile Send private message
UpkarSharma
PostPosted: Mon Oct 29, 2001 11:49 pm    Post subject: Reply with quote

Apprentice

Joined: 15 Aug 2001
Posts: 27
Location: Mumbai

For checking the port number, right click the selected QueueManager in MQExplorer, select "All tasks" --> "Services".... You will see another window for MQServices.

Select Queue Manager --> Listener... Right click Lister and select "Properties" ...
Go to "Parameters" tab and u will find the port number there.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Bindings mode works but can’t connect using client mode
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.