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 Java / JMS » Java API : Opening command queue yields error code 2042

Post new topic  Reply to topic
 Java API : Opening command queue yields error code 2042 « View previous topic :: View next topic » 
Author Message
abe
PostPosted: Mon Jul 04, 2011 7:33 am    Post subject: Java API : Opening command queue yields error code 2042 Reply with quote

Newbie

Joined: 04 Jul 2011
Posts: 2

Hello,

I'm trying to write a Java application which issues MQ commands on a Queue Manager. However, I always receive error 2042 when I try to open the "SYSTEM.ADMIN.COMMAND.QUEUE" queue.

My code looks like that :

Code:
MQQueueManager qMgr = new MQQueueManager("BLAH");
int openOptions = MQC.MQOO_OUTPUT | MQC.MQOO_INPUT_SHARED;
MQQueue system_default_local_queue = Mgr.accessQueue("SYSTEM.ADMIN.COMMAND.QUEUE", openOptions);


I have no other applications connected to the Queue Manager (It is a local server).

Is there something I missed ? What am I doing wrong ?

TYIA,
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Jul 04, 2011 8:49 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Why are you using any input options opening the queue. I thought the command server used open exclusive....
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
abe
PostPosted: Tue Jul 05, 2011 12:34 am    Post subject: Reply with quote

Newbie

Joined: 04 Jul 2011
Posts: 2

In fact I tried different values for openOptions but all of them generates an error.

Code:
int openOptions = MQC.MQOO_INPUT_EXCLUSIVE;
alone and
Code:
int openOptions = MQC.MQOO_OUTPUT | MQC.MQOO_INPUT_EXCLUSIVE;
gives an error 2042 as well.

[/code]
Back to top
View user's profile Send private message
zpat
PostPosted: Tue Jul 05, 2011 12:44 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

Not too surprising as the command server opens this with exclusive input.

Your program is not replacing the command server! Why are you trying to read this queue anyway?

You should be putting to it, and specifying a reply queue for the response.
Back to top
View user's profile Send private message
RogerLacroix
PostPosted: Tue Jul 05, 2011 7:43 am    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3264
Location: London, ON Canada

abe wrote:
In fact I tried different values for openOptions but all of them generates an error.

Code:
int openOptions = MQC.MQOO_INPUT_EXCLUSIVE;
alone and
Code:
int openOptions = MQC.MQOO_OUTPUT | MQC.MQOO_INPUT_EXCLUSIVE;
gives an error 2042 as well.

Wow. You truly don't understand what you are trying to accomplish.

Please read the manual. You should ONLY be writing to the command queue.

Code:
int openOptions = MQC.MQOO_OUTPUT | MQC.MQOO_FAIL_IF_QUIESCING;


Regards,
Roger Lacroix
Capitalware Inc.
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Java API : Opening command queue yields error code 2042
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.