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 » MQ error still thrown on System.err

Post new topic  Reply to topic
 MQ error still thrown on System.err « View previous topic :: View next topic » 
Author Message
snap
PostPosted: Thu Apr 05, 2007 11:47 pm    Post subject: MQ error still thrown on System.err Reply with quote

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
View user's profile Send private message
snap
PostPosted: Fri Apr 06, 2007 12:18 am    Post subject: Reply with quote

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
View user's profile Send private message
Michael Dag
PostPosted: Fri Apr 06, 2007 2:08 am    Post subject: Reply with quote

Jedi Knight

Joined: 13 Jun 2002
Posts: 2607
Location: The Netherlands (Amsterdam)

thanks for sharing!
_________________
Michael



MQSystems Facebook page
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » MQ error still thrown on System.err
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.