|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MQ error still thrown on System.err |
« View previous topic :: View next topic » |
Author |
Message
|
snap |
Posted: Thu Apr 05, 2007 11:47 pm Post subject: MQ error still thrown on System.err |
|
|
Newbie
Joined: 05 Apr 2007 Posts: 2
|
Hi,
I have just a small/basic question about MQException api.
I'm doing basic R/W operations on a queue (in bindings mode) with classic mq, no jms, I'm catching MQException, everything works find.
What bothers me is that the exception is still thrown on System.err and so displayed on the output. For example, I do a get on an empty queue, I get exception with reasonCode MQException.MQRC_NO_MSG_AVAILABLE, I display the mesage "queue is empty.", but the output still include the mq exception completion and reason code, like that:
Code: |
Loading configuration ... done
[color=red]MQJE001: Completion Code 2, Reason 2033[/color]
queue is empty.
|
Could you tell me please how can I get rid off the MQJE...? Because my code doesn't display it, I assume that the API is throwing it by default.
Thank you in advance. |
|
Back to top |
|
 |
snap |
Posted: Fri Apr 06, 2007 12:18 am Post subject: |
|
|
Newbie
Joined: 05 Apr 2007 Posts: 2
|
I got the answer myself, but I'm not gonna tell ya... Just kidding...
On the Using Java manual, there is mention the following:
Exceptions that are thrown while a WebSphere MQ base Java application is running are also written to the log. However, an application can call the MQException.logExclude() method to prevent exceptions associated with a specific reason code from being logged. You might want to do this in situations where you expect many exceptions associated with a specific reason code to be thrown, and you do not want the log to be filled with these exceptions.
I just included
Code: |
MQException.log = null; |
somewhere in my init code.
That's it. |
|
Back to top |
|
 |
Michael Dag |
Posted: Fri Apr 06, 2007 2:08 am Post subject: |
|
|
 Jedi Knight
Joined: 13 Jun 2002 Posts: 2607 Location: The Netherlands (Amsterdam)
|
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|