Author |
Message
|
roliv |
Posted: Fri Oct 26, 2001 12:54 pm Post subject: |
|
|
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 |
|
 |
kolban |
Posted: Fri Oct 26, 2001 2:19 pm Post subject: |
|
|
 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 |
|
 |
UpkarSharma |
Posted: Sun Oct 28, 2001 8:44 pm Post subject: |
|
|
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 |
|
 |
roliv |
Posted: Mon Oct 29, 2001 10:17 am Post subject: |
|
|
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 |
|
 |
bower5932 |
Posted: Mon Oct 29, 2001 2:51 pm Post subject: |
|
|
 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 |
|
 |
kolban |
Posted: Mon Oct 29, 2001 4:09 pm Post subject: |
|
|
 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 |
|
 |
roliv |
Posted: Mon Oct 29, 2001 5:40 pm Post subject: |
|
|
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 |
|
 |
kolban |
Posted: Mon Oct 29, 2001 8:07 pm Post subject: |
|
|
 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 |
|
 |
UpkarSharma |
Posted: Mon Oct 29, 2001 11:49 pm Post subject: |
|
|
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 |
|
 |
|