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 » General IBM MQ Support » MQ series 5.3 Closure reason = 2009 error

Post new topic  Reply to topic
 MQ series 5.3 Closure reason = 2009 error « View previous topic :: View next topic » 
Author Message
ramdas
PostPosted: Wed Oct 23, 2002 8:54 pm    Post subject: MQ series 5.3 Closure reason = 2009 error Reply with quote

Newbie

Joined: 23 Oct 2002
Posts: 4
Location: Mumbai

Hello,


MQ series 5.3 server is installed on my m/c.I am trying to connect to queue manager.

The Java code for connecting to Queu Manager is as follows

******************************************************

import com.ibm.mq.MQC;
import com.ibm.mq.MQEnvironment;
import com.ibm.mq.MQException;
import com.ibm.mq.MQMessage;
import com.ibm.mq.MQPutMessageOptions;
import com.ibm.mq.MQQueue;
import com.ibm.mq.MQQueueManager;
import java.io.IOException;
import javax.transaction.*;


public class QueueWriter

{



private String hostname = "172.22.14.89";
private String queueManagerName = "TestQM";
private int port = 5004;
//ivate String channel ="rs";
private String queueName = "inqueue";

private String[] messages = {"First Message", "Second Message", "Third Message", "Fourth Message", "Fifth and last Message" };

private MQQueueManager queueManager = null;
private MQQueue queue = null;


public QueueWriter()
{
super();
}

public void initialize() throws Exception
{


MQEnvironment.hostname = hostname;
//MQEnvironment.channel = channel;
MQEnvironment.port = port;


try
{
queueManager = new MQQueueManager("TestQM");
}
catch (Exception e)
{
System.out.println("Could not connect to a queue manager * please do not use *---------------"+ e);
throw e;
}
System.out.println("Got the Handle to Q Mgr");


}



public static void main(String[] ignore)
{

QueueWriter sample = new QueueWriter();

try
{
sample.initialize();
}
catch (Exception e)
{
System.out.println("Error in initialization. Exiting...");
e.printStackTrace();
System.exit(1);
}

System.out.println("Wrote all messages successfully.");

}//main

}


******************************************************
on running it gives following error


MQJE016: MQ queue manager closed channel immediately during connect
Closure reason = 2009
MQJE001: Completion Code 2, Reason 2009
Could not connect to a queue manager * please do not use *---------------com.ibm.mq.MQException:
MQJE001: Completion Code 2, Reason 2009
Error in initialization. Exiting...
com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2009
at com.ibm.mq.MQManagedConnectionJ11.<init>(MQManagedConnectionJ11.java:
172)
at com.ibm.mq.MQClientManagedConnectionFactoryJ11._createManagedConnecti
on(MQClientManagedConnectionFactoryJ11.java:270)
at com.ibm.mq.MQClientManagedConnectionFactoryJ11.createManagedConnectio
n(MQClientManagedConnectionFactoryJ11.java:290)
at com.ibm.mq.StoredManagedConnection.<init>(StoredManagedConnection.jav
a:80)
at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConne
ctionManager.java:150)
at com.ibm.mq.MQQueueManager.obtainBaseMQQueueManager(MQQueueManager.jav
a:678)
at com.ibm.mq.MQQueueManager.construct(MQQueueManager.java:616)
at com.ibm.mq.MQQueueManager.<init>(MQQueueManager.java:393)
at QueueWriter.initialize(QueueWriter.java:47)
at QueueWriter.main(QueueWriter.java:6


Kindly help me to fix this problem.
Back to top
View user's profile Send private message Yahoo Messenger
kavithadhevi
PostPosted: Thu Oct 24, 2002 5:44 am    Post subject: Reply with quote

Master

Joined: 14 May 2002
Posts: 201
Location: USA

Hi,
When you are using mq.jar , you have to give the channel name. Also check your channel.
MQEnvironment.channel ="rs";

Try this.
_________________
Thanks in Advance.

Kavitha
IBM Certified System Administrator
Websphere MQ v 5.3
www.zealphoenix.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ramdas
PostPosted: Fri Oct 25, 2002 2:52 am    Post subject: Reply with quote

Newbie

Joined: 23 Oct 2002
Posts: 4
Location: Mumbai

Thanks for the reply.

I an trying to connect on the local m/c.(ie m/c on which server is installed)
Hence Channel may not be required.
We have also tried with channel still the problem persist.

Can somebody give me refernce of place where i can find info on it


ramdas
Back to top
View user's profile Send private message Yahoo Messenger
bower5932
PostPosted: Fri Oct 25, 2002 7:16 am    Post subject: Reply with quote

Jedi Knight

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

I just tried your program with minor changes for my environment and it worked. The one major change that I made was to set the channel name:

private String channel ="SYSTEM.DEF.SVRCONN";

and

MQEnvironment.channel = channel;

Without this, I get the 2009. Even if your client is on the same box as the Qmgr, you need the channel name. If you tell MQSeries that you will be using a client connection, it will use tcp/ip (and a channel) to find the queue manager.

If you know for a fact that you are always going to be running on the same machine as the Qmgr, you could use bindings mode and skip the hostname, port, channel.

If you did specify a channel and it failed, I'd suggest that you double-check that the actual channel exists (and this includes the case of the name). You should be able to test with SYSTEM.DEF.SVRCONN since that is the default channel that MQ creates.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
ramdas
PostPosted: Sun Oct 27, 2002 2:42 am    Post subject: Reply with quote

Newbie

Joined: 23 Oct 2002
Posts: 4
Location: Mumbai

Thank's everybody.

The problem is solved when I specified the Server Connection Channel
Back to top
View user's profile Send private message Yahoo Messenger
shubhrajit_c
PostPosted: Sun Oct 27, 2002 7:39 pm    Post subject: Reply with quote

Novice

Joined: 01 Nov 2001
Posts: 14
Location: India

If you are working on the same m/c you need not specify a channel. Insteaed you can configure your queuemanager to set channel auto definition

the attribute to be set is CHAD
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » MQ series 5.3 Closure reason = 2009 error
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.