|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
An MQSeries error occurred :Completion code 2Reason code 200 |
« View previous topic :: View next topic » |
Author |
Message
|
kumarkalva |
Posted: Mon Jul 23, 2007 5:45 am Post subject: An MQSeries error occurred :Completion code 2Reason code 200 |
|
|
Newbie
Joined: 20 Jul 2007 Posts: 1
|
hi
this is the code what i have written to post messeage in to MQ
try{
MQEnvironment.hostname = hostname;
MQEnvironment.channel = channel;
// Create a connection to the queue manager
qMgr =new MQQueueManager(qManager);
System.out.println("qMgr"+qMgr);
// Set up the options on the queue we wish to open...
// Note. All MQSeries Options are prefixed with MQC in Java.
int openOptions =MQC.MQOO_INPUT_AS_Q_DEF |MQC.MQOO_OUTPUT ;
System.out.println("openOptions"+openOptions);
// Now specify the queue that we wish to open,and the open options.
// Here the queue name is "default".
MQQueue system_default_local_queue = qMgr.accessQueue("Q_FileNetMsgs",
openOptions);
//System.out.println("MQQueue system_default_local_queue"+MQQueue system_default_local_queue);
// Define a simple MQSeries message, and
//write some text in UTF format..
MQMessage test_kishore =new MQMessage();
test_kishore.writeUTF("hey this is kishore");
// specify the message options...
MQPutMessageOptions pmo =new MQPutMessageOptions();
// accept the defaults,
// same as MQPMO_DEFAULT constant.
// put the message on the queue.
system_default_local_queue.put(test_kishore,pmo);
System.out.println("Message put on queue");
system_default_local_queue.close();
// Put the message for 10 seconds.View the message on the queue.
Thread.sleep(10000);
// get the message back again...
// First define a MQSeries message buffer to
//receive the message into..
// Note: Open the queue for browsing option. (Important)
openOptions = MQC.MQOO_BROWSE;
MQQueue system_default_local_queue1 = qMgr.accessQueue("default",
openOptions);
MQMessage retrievedMessage =new MQMessage();
retrievedMessage.messageId =test_kishore.messageId;
// Set the get message options..
MQGetMessageOptions gmo =new MQGetMessageOptions(); // accept the defaults
// same as MQGMO_DEFAULT
// Note: This is important. Set Get message option for browsing only.
gmo.options = MQC.MQGMO_BROWSE_FIRST;
// get the message off the queue..
system_default_local_queue1.get(retrievedMessage,gmo);
System.out.println("Message retrieved from the queue");
// And prove we have the message by displaying the UTF message text
String msgText =retrievedMessage.readUTF();
System.out.println("The message is:"+msgText);
// Close the queue.
system_default_local_queue1.close();
// Disconnect from the queue manager.
qMgr.disconnect();
} // End of try
// If an error has occurred in the above, try to identify what went wrong.
// Was it an MQSeries error?
catch (MQException ex) {
System.out.println("An MQSeries error occurred :Completion code "+
ex.completionCode +"Reason code "+ex.reasonCode);
}
// Was it a Java buffer space error?
catch (java.io.IOException ex) {
System.out.println("An error occurred whilst writing to the message buffer: " + ex);
}
// Was it any other exception including java.lang.InterruptedException caused
// by Thread.sleep(10000) method.
catch (Exception ex) {
System.out.println("An error occurred whilst writing to the message buffer:"+ex);
} //End of catch.
i'm getting the error like
MQJE001: An MQException occurred: Completion Code 2, Reason 2009
MQJE016: MQ queue manager closed channel immediately during connect
Closure reason = 2009
MQJE001: An MQException occurred: Completion Code 2, Reason 2009
MQJE016: MQ queue manager closed channel immediately during connect
Closure reason = 2009
An MQSeries error occurred :Completion code 2Reason code 2009
please help me on this
thanks in advance
kishore |
|
Back to top |
|
 |
Vitor |
Posted: Mon Jul 23, 2007 6:45 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Do a search in here for 2009 (a connection broken error). It's been discussed many times and some of the resolutions may be valuable to you. Understand that it may not (indeed probably is not) a problem with your code. Double check that your connection is configured correctly, especially if your code has never worked; pay particular attention to network software like firewalls between you and the queue manager.
The search will throw up more lines of enquiry. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
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
|
|
|
|