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 » IBM MQ API Support » 2045 error on accessing the remote queue

Post new topic  Reply to topic
 2045 error on accessing the remote queue « View previous topic :: View next topic » 
Author Message
navjotkaur78
PostPosted: Tue Feb 28, 2006 11:28 pm    Post subject: 2045 error on accessing the remote queue Reply with quote

Apprentice

Joined: 09 Feb 2006
Posts: 31

I'm trying to send mesaage to a remote QM in MQV6. i've 2 QM's , QM1 and QM2. QM1 have remote queue Q2. when i run the java code


public class Intercommunication {

private String qManager1 ="QM1";
private MQQueueManager qMgr;

public Intercommunication() {
try {
qMgr = new MQQueueManager(qManager1);
int openOptions = MQC.MQOO_INPUT_AS_Q_DEF |MQC.MQOO_OUTPUT ;
MQQueue queue1 = qMgr.accessQueue("Q2",openOptions);
MQMessage hello = new MQMessage();
hello.writeUTF("this is test message");
MQPutMessageOptions pmo = new MQPutMessageOptions();
queue1.put(hello,pmo);
System.out.println("Message put in the Remote Queue");
queue1.close();
qMgr.disconnect();
} catch (MQException e) {
e.printStackTrace();
} catch (IOException e1) {
e1.printStackTrace();
}
}
}


i get the following error on the line
MQQueue queue1 = qMgr.accessQueue("Q2",openOptions);


MQJE001: Completion Code 2, Reason 2045
com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2045
at com.ibm.mq.MQQueueManager.accessQueue(MQQueueManager.java:2854)
at com.ibm.mq.MQQueueManager.accessQueue(MQQueueManager.java:2911)
at sample.Intercommunication.<init>(Intercommunication.java:32)
at sample.Intercommunication.main(Intercommunication.java:70)
Back to top
View user's profile Send private message
vennela
PostPosted: Tue Feb 28, 2006 11:33 pm    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

Your options are not valid

Change open options to
Code:
int openOptions = MQC.MQOO_OUTPUT ;


Also

Code:

C:\Documents and Settings\admin>mqrc 2045

      2045  0x000007fd  MQRC_OPTION_NOT_VALID_FOR_TYPE

C:\Documents and Settings\admin>


When you get an MQ error use mqrc to find what it is
Back to top
View user's profile Send private message Send e-mail Visit poster's website
navjotkaur78
PostPosted: Tue Feb 28, 2006 11:37 pm    Post subject: Reply with quote

Apprentice

Joined: 09 Feb 2006
Posts: 31

Hey thanx!! it worked!!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » 2045 error on accessing the remote queue
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.