|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MQJE016 : channel closed immediately |
« View previous topic :: View next topic » |
Author |
Message
|
java_ppl |
Posted: Fri Dec 29, 2006 10:27 am Post subject: MQJE016 : channel closed immediately |
|
|
Novice
Joined: 22 Sep 2006 Posts: 13
|
hi I am trying a simple Java program(MQ Client ) on a Solaris sever, to put a message on a queue .
The code snippet looks like this:
public static void main(String[] args) {
new MQSample();
}
MQSample()
{
MQEnvironment.hostname = "hostname";
MQEnvironment.channel = "channelname";
MQEnvironment.port = 1419;
MQQueue queue=null;
//MQException.log = null;
MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT);
try {
qmgr = new MQQueueManager(qManager);
}
catch (MQException e)
{
appendToTextFile(f,"Error while creating QUEUE MANAGER: "+qManager + "...\n");
}
int openOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_OUTPUT ;
etc...
But I am getting the following error :
MQJE001: An MQException occurred: Completion Code 2, Reason 2009
MQJE016: MQ queue manager closed channel immediately during connect
Closure reason = 2009
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I have checked the hostname, port,and channel values that I have provided thru the program..all are correct.
Could someone please tell me what could be the problem here?
Thanks ! |
|
Back to top |
|
 |
pathipati |
Posted: Fri Dec 29, 2006 10:46 am Post subject: |
|
|
Master
Joined: 03 Mar 2006 Posts: 296
|
|
Back to top |
|
 |
java_ppl |
Posted: Tue Jan 02, 2007 3:10 am Post subject: |
|
|
Novice
Joined: 22 Sep 2006 Posts: 13
|
Hi,
Yes . The channel is running. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Jan 02, 2007 4:41 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Is the channel spelled correctly? Remember this is case sensitive...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
naek |
Posted: Sun Jan 14, 2007 11:07 pm Post subject: |
|
|
Newbie
Joined: 10 Jan 2007 Posts: 6
|
Hi, I got the same problem a week ago but got the solution.
My previous problem:
My program works fine when the queue manager that i want to access is located in different machine, but failed (with the same error like you got) when the queue manager is located on the same machine.
After some testing, I found that we do not need to fill the MQEnvironment.hostname if the MQ manager we are going to access is located in same machine with the program that access it. We also do not need to specify MQEnvironment.channel and MQEnvironment.port if the queue manager is local.
I change my program to look like this one (just pseudo):
hostname="the host name/ ip address";
if (hostname is not local) than {
MQEnvironment.hostname = "hostname";
MQEnvironment.channel = "channelname";
MQEnvironment.port = xxx;
}
I use java.net package to test whether a given hostname is local or not.
My environment: IBM MQ 5.3 on Windows 2003 and use MQ Java API.
I hope my experience is helping you. |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Jan 15, 2007 6:03 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
It should work regardless whether the host is local or not. What might interfere however is some firewall setting, or the wrong port number, or the wrong user running the listener, etc ...
Read up on 2009 return code by doing a search on the forum.
There are reasons why you might want to have a client connection to a local qmgr in your program....
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|