Author |
Message
|
gali_sridhar |
Posted: Thu Jun 06, 2002 2:45 am Post subject: Java Error while opening QueueManager |
|
|
Novice
Joined: 31 May 2002 Posts: 16
|
Hi,
I am getting the following error while opening the Queue Manager from a simple java program. Any suggesions or ideas...
C:\>java SPut
MQJE016: MQ queue manager closed channel immediately during connect
Closure reason = 2009
MQJE001: Completion Code 2, Reason 2009
Error Found in MQE : com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason
2009
Thanks,
Sridhar |
|
Back to top |
|
 |
kolban |
Posted: Thu Jun 06, 2002 6:38 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2001 Posts: 1072 Location: Fort Worth, TX, USA
|
Can you post the code of the application and also provide details of the definition of the target queue manager? Especially its channel, hostname, IP and port. |
|
Back to top |
|
 |
RogerLacroix |
Posted: Thu Jun 06, 2002 7:24 pm Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
Hi,
Check your channel name. I get this error when I mis-type the channel name.
later
Roger... |
|
Back to top |
|
 |
gali_sridhar |
Posted: Thu Jun 06, 2002 8:28 pm Post subject: |
|
|
Novice
Joined: 31 May 2002 Posts: 16
|
Hi,
I am working on WinNT Server and also the MQSeries Server. The sample application AMQSPUT & Get are working fine in Putting/Getting Messages. Since my Java Code is not working and i hv written a small code for putting messages. I am attaching the code, without any changes this code is working fine in other systems.
Code: |
import com.ibm.mq.*;
import com.ibm.mq.MQQueueManager;
import com.ibm.mq.MQException;
public class SPut {
private MQQueueManager qMgr;
private String QManager = "QM";
private String hostname = "NEFTRNG1";
private int portnumber = 1415;
private void init(){
MQEnvironment.hostname = hostname;
MQEnvironment.port = portnumber;
MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY,MQC.TRANSPORT_MQSERIES);
}
public void conn(){
try{
System.out.println("1");
qMgr = new MQQueueManager(QManager); // creaitng a connection to queue Manager
int openOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_OUTPUT ; // open options for opening a queue
MQQueue localQ = qMgr.accessQueue("LQ", openOptions,null, null, null); // Opening a Queue
MQMessage msg = new MQMessage(); // creating message connection
msg.writeUTF("Sridhar Gali");
MQPutMessageOptions pmo = new MQPutMessageOptions(); //put message options
localQ.put(msg,pmo);
localQ.close(); //closing connection for Queue
qMgr.disconnect(); //Disconnecting the Queue Manager
}
catch(MQException e){
System.out.println("Error Found in MQE : " + e);
}
catch(Exception e){
System.out.println("Error Found in : " + e);
}
}
public static void main(String arg[]){
SPut xyz = new SPut();
xyz.init();
xyz.conn();
}
} |
Since this is a MQ Server, i never specified the CHANNEL NAME. If i hv to specify the channel name, what to specify???
Thanks for the Responses,
Sridhar |
|
Back to top |
|
 |
RogerLacroix |
Posted: Thu Jun 06, 2002 8:50 pm Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
Hi,
If you are running the Java program on the same box as the queue manager (binding mode) then why are you specifying hostname and portnumber? The hostname should be set to null.
later
Roger... |
|
Back to top |
|
 |
gali_sridhar |
Posted: Thu Jun 06, 2002 9:02 pm Post subject: |
|
|
Novice
Joined: 31 May 2002 Posts: 16
|
The hostname itself the SERVER name. Anyhow I removed the hostname and executed it. It gives me the following error.
MQJE001: Completion Code 2, Reason 2059
Error Found in MQE : com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2059
It works fine with AMQSPUT.
If I commented the INIT method. it gives the above error.
Regards & Thanks,
Sridhar |
|
Back to top |
|
 |
wojtekg |
Posted: Fri Jun 07, 2002 1:43 am Post subject: |
|
|
 Newbie
Joined: 20 May 2002 Posts: 4
|
maybe you should try to define also a channel of 'server connection' type |
|
Back to top |
|
 |
RogerLacroix |
Posted: Fri Jun 07, 2002 8:11 pm Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
Hi,
You do NOT need a server channel when you are using "bindings" mode.
Do you have a queue manager (on the same box) called "QM"? (QM in uppercase not lowercase? e.g. In MQSeries, objects are case sensitive, "QM" != "qm").
Also, uncomment your your init call and code it as follows:
Code: |
private void init(){
MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY,MQC.TRANSPORT_MQSERIES);
} |
later
Roger... |
|
Back to top |
|
 |
gali_sridhar |
Posted: Sat Jun 08, 2002 3:11 am Post subject: |
|
|
Novice
Joined: 31 May 2002 Posts: 16
|
Hi,
'QM' is a capitals. I tried by comments the code and executed but still the same problem. The funny thing is that all my previous written programs r also failing and giving me this error.
I did re-installation for 5.2.1 recently. Is it the reason!!! because I installed it twice since I am getting this error.
Regards,
Sridhar |
|
Back to top |
|
 |
araghav |
Posted: Mon Jun 10, 2002 4:42 am Post subject: Try to run through non-Java program |
|
|
Novice
Joined: 21 May 2002 Posts: 12
|
Have you tried to put message through any other program / utility, like first-step utility or anything else. This will let you know if error is due to MQ Set up or you are getting it because of Java code.
There could be so many reasons. We also got this problem and eventually it turns out to be some socket problem. |
|
Back to top |
|
 |
RogerLacroix |
Posted: Mon Jun 10, 2002 8:02 pm Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
The one thing that I have learned with MQ, is that it is always better to do an un-install first then do the new, fresh install.
I seem to have bad luck doing an upgrade or re-install over a previous copy. (Something always fails.)
Therefore, I would suggest doing an un-install, (any cleanup if necessary), reboot and then re-install.
later
Roger... |
|
Back to top |
|
 |
gali_sridhar |
Posted: Thu Jun 13, 2002 5:39 am Post subject: Thanks Guys |
|
|
Novice
Joined: 31 May 2002 Posts: 16
|
Hi Guys,
Thanks you very much for Ur help!!
I will be out of MQSeries Project for couple of months.
Thanks all the people who r postings message in this groups and wish U all the best.
Regards,
Sridhar |
|
Back to top |
|
 |
|