Author |
Message
|
abe |
Posted: Mon Jul 04, 2011 7:33 am Post subject: Java API : Opening command queue yields error code 2042 |
|
|
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 |
|
 |
fjb_saper |
Posted: Mon Jul 04, 2011 8:49 am Post subject: |
|
|
 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 |
|
 |
abe |
Posted: Tue Jul 05, 2011 12:34 am Post subject: |
|
|
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 |
|
 |
zpat |
Posted: Tue Jul 05, 2011 12:44 am Post subject: |
|
|
 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 |
|
 |
RogerLacroix |
Posted: Tue Jul 05, 2011 7:43 am Post subject: |
|
|
 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 |
|
 |
|