Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MQJE016: MQ queue manager closed channel immediately during connect

Status
Not open for further replies.

john2002

Programmer
Mar 20, 2002
3
US
Hi,
I am trying to connect to the remote Queue manager from NT box using MQSeries 5.2 using java.
when I tried to run my java program its throwing me this error

MQJE016: MQ queue manager closed channel immediately during connect
Closure reason = 22
MQJE001: Completion Code 2. Reason 2009

Can some one help me on this error

Here is my sample code I tried to connect to remote machine.

import com.ibm.mq.*;
public class Send1
{
public static String hostname = "remote host name";
public static String channel = "channal name";
public static String qManager = "locan qmanager name" ;
public static String queue = "queue name";
public static MQQueueManager qMgr;

public static void main(String args[]) {
MQEnvironment.hostname = hostname;
MQEnvironment.channel = channel;
try {
qMgr = new MQQueueManager(qManager);
int openOptions = MQC.MQOO_OUTPUT ;
MQQueue system_default_local_queue = qMgr.accessQueue(queue ,openOptions);
MQMessage hello_world = new MQMessage();
hello_world.writeUTF("Hello World!" ) ;
MQPutMessageOptions pmo = new MQPutMessageOptions();
system_default_local_queue.put(hello_world,pmo);
system_default_local_queue.close();
qMgr.disconnect();
}
catch (MQException ex)
{
System.out.println("An MQ error occurred : Completion code " +
ex.completionCode +
" Reason code " + ex.reasonCode);
}
catch (java.io.IOException e)
{
System.out.println("An error occurred while writing to the message buffer: " + e );
}
}
}


Anything wrong on this code?
 
First of all ensure that all your settings are correct, check the names of qmgr,q and so on (case sensitive!); check your listener's port number and add it as MQEnvironment.port in your code, if all fails try to reinstall MQSeries
 
THIS IS 101% ENVIRONMENT PROBLEM

CHECK ALL THE ENVIRONMENT PROPERTIES
LIKE HOSTNAME,PORT,SERVER CHANNEL
QUEUE MANAGER NAME ETC.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top