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 » WebSphere Message Broker (ACE) Support » How to thow exception from Java compute node in MB V6

Post new topic  Reply to topic
 How to thow exception from Java compute node in MB V6 « View previous topic :: View next topic » 
Author Message
CuriCAT
PostPosted: Wed Oct 11, 2006 12:49 am    Post subject: How to thow exception from Java compute node in MB V6 Reply with quote

Voyager

Joined: 26 Sep 2006
Posts: 82

I want to thow exception from Java compute node, I am using Message Broker V6.

we can only allowed to throw MbException from the evaluate methode. How can I handle other exceptions such as IOException or User defined exceptions.

How can we throw those exceptions to the flow, I have attached error handling subflow to catch terminal of Inputnode, I want to handle these user defined exceptions there instead at java compute node.


My Code :
public class FTPTest_JavaCompute extends MbJavaComputeNode{

public void evaluate(MbMessageAssembly contact admin) throws MbException {
try{
// My code
}
catch(Exception){

// here want to handle and thow the exception to the flow
// or want to update in the Exception List


}
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Yaroslav
PostPosted: Wed Oct 11, 2006 1:06 am    Post subject: Reply with quote

Novice

Joined: 28 Sep 2006
Posts: 12
Location: Russia

As MbUserException inherited from MbException.
You may simple use operator "throw new MbUserException(...)"
in your evaluate method.
_________________
IBM Certified Solution Designer WebSphere MQ V6.0
IBM Certified Solution Developer WebSphere Message Broker V6.0
Back to top
View user's profile Send private message
CuriCAT
PostPosted: Wed Oct 11, 2006 1:48 am    Post subject: Reply with quote

Voyager

Joined: 26 Sep 2006
Posts: 82

Thanks,

But how will you handle IOException as it is, you can not throw IOException, you can only throw MbException from evaluate function.

How to do this ? I am trying to access file and when there is IOException I can not trhow as it is. Instead I should only be able to thow MbException or MbUserException (as you said)

How to do this ?
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
elvis_gn
PostPosted: Wed Oct 11, 2006 2:01 am    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi ganeshgurukkal,

Throw a User Exception and in the Text fields specify the IO Error...You cannot be creating your own ExceptionList structure...work with whats closest.

Regards.
Back to top
View user's profile Send private message Send e-mail
CuriCAT
PostPosted: Wed Oct 11, 2006 2:44 am    Post subject: Reply with quote

Voyager

Joined: 26 Sep 2006
Posts: 82

Thanks,

I was doing the same, Still I was curious to know is there any other way. I have used as follows.

throw new MbRecoverableException("MyCustomClass","evaluate",inMessage.getRootElement().getName(),"",exception.toString(),null);
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » How to thow exception from Java compute node in MB V6
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.