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 Discussion » Reason code 2045 : help needed

Post new topic  Reply to topic
 Reason code 2045 : help needed « View previous topic :: View next topic » 
Author Message
Vishy
PostPosted: Thu Oct 02, 2003 11:40 am    Post subject: Reason code 2045 : help needed Reply with quote

Novice

Joined: 30 Jul 2003
Posts: 21

In my code I am specifying the open options on the Q as follows
int openOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_OUTPUT;

It works fine, if I use SYSTEM.DEFAULT.LOCAL.QUEUE, but once I change it to Queue name specified for development environment, I get the following error ""Completion code 2 Reason code 2045""
Please note that I am using the Q to just put the message on the Q, I am not expecting back any reply.

In the error codes explanation, it says the reason is one of the following
MQRC_OPTION_NOT_VALID_FOR_TYPE
An option that is inappropriate for the object type (for example, MQOO_OUTPUT for an MQOT_PROCESS object).
An option that is unsupported for the queue type (for example, MQOO_INQUIRE for a remote queue that has no local definition).
One or more of the following options:
MQOO_INPUT_AS_Q_DEF



public static int sendMessage(String m_msg,String hn, String ch,int pt,String qManager, String mqQName) throws MQException,Exception{

MQQueueManager qMgr = null;
byte[] message_Id = null;
String msgData = null;
MQQueue system_default_local_queue = null;

try{
MQEnvironment.channel = ch;
MQEnvironment.hostname = hn;
MQEnvironment.port = pt;

// Create a connection to QManager
qMgr = new MQQueueManager(qManager);

// Set up the options on the Q we wish to open
int openOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_OUTPUT;

// Now specify the Q that we wish to open and the open options
system_default_local_queue = qMgr.accessQueue(mqQName, openOptions);

// Define a simple message
MQMessage mqMsg = new MQMessage();
mqMsg.format = MQC.MQFMT_STRING;
mqMsg.priority = MQC.MQPRI_PRIORITY_AS_Q_DEF;
mqMsg.expiry = 1200;
mqMsg.writeString(m_msg);
MQPutMessageOptions mqPMO = new MQPutMessageOptions();

// Put the message on the Q
system_default_local_queue.put(mqMsg,mqPMO);
rset3 = stmt1.executeQuery ("UPDATE NXT_PSFT_XML_DOCUMENTS SET PROCESSED_FLAG='Y' WHERE PROCESSED_ID =" +m_processed_id);
message_Id = mqMsg.messageId;
System.out.println("The message Id is" + mqMsg.messageId );

// Close the Q
system_default_local_queue.close();

// Disconnect from QueueManager
qMgr.disconnect();
return 0;

} catch (MQException ex) {

System.out.println("A WebSphere MQ error occurred : Completion code " + ex.completionCode + " Reason code " + ex.reasonCode);
return 1;
} catch(SQLException sqle) {
System.out.println("Unable to Access the database");
return 2;
} catch(Exception e) {
System.out.println("Exception caught");
return 3;
}


}

Please help me in resolving this. Thanks in advance

Vishy
Back to top
View user's profile Send private message Yahoo Messenger
Ratan
PostPosted: Thu Oct 02, 2003 12:01 pm    Post subject: Reply with quote

Grand Master

Joined: 18 Jul 2002
Posts: 1245

check the difference between SYSTEM.DEFAULT.LOCAL.QUEUE and the queue in question.

Posting the Qdefinition of the Q in question will be helpful.
_________________
-Ratan
Back to top
View user's profile Send private message Send e-mail
vennela
PostPosted: Thu Oct 02, 2003 12:45 pm    Post subject: Reply with quote

Jedi Knight

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

If you are not getting from the queue then change your open options

Code:

int openOptions = MQC.MQOO_OUTPUT;



-------
Venny
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mqonnet
PostPosted: Fri Oct 03, 2003 5:16 am    Post subject: Reply with quote

Grand Master

Joined: 18 Feb 2002
Posts: 1114
Location: Boston, Ma, Usa.

Since you did not mention the type of queue you were trying to work on, my guess is that you were running this app and trying to work on a REMOTE QUEUE. Which cannot be opened for input and hence you got options error.

As venny suggested, be discrete. If you are not planning on doing a get on the same queue in the same app, why do you need to use open options for get(input).

Cheers
Kumar
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General Discussion » Reason code 2045 : help needed
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.