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 » Java User defined extensions and Exception Handling

Post new topic  Reply to topic
 Java User defined extensions and Exception Handling « View previous topic :: View next topic » 
Author Message
hallmark
PostPosted: Mon May 23, 2005 4:40 am    Post subject: Java User defined extensions and Exception Handling Reply with quote

Voyager

Joined: 10 Mar 2005
Posts: 76

Hello,

I am at my wit's end trying to write a java user defined extension. I have written one that writes to a database using JDBC. However I cannot figure out how to deal with exceptions (e.g. SQLException). I catch the exception in the evaluate method, but I need to throw it out of the node so that it can be dealt with using a subsequent error handling flow. I try to create an MbUserException as follows

throw new MbUserException(this.getClass().getName(), "DatabaseInsertClobNode",
"resources",
"SQLE",
sqle.getMessage(),
new Object[]{sqle});

using the documented constructor.

public MbUserException(String className,
String methodName,
String messageSource,
String messageKey,
String traceText,
Object[] inserts)

I think message source and key can refer to a ResourceBundle which I have tried to implement.
I don't know what inserts are???

I have a resource file which consists of key value pairs for error messages but my message comes out as follows:

<com.ibm.broker.plugin.MbUserException class:com.ibm.semaphore.plugin.DatabaseInsertClobNode method:DatabaseInsertClobNode source:resources key:SQLEmessage: Unable to resolve message: Source: resourcesKey: SQLE >


Further up the exception list:
Unhandled exception in plugin method

I can find no documentation to carry out error handling, most sample code I have found just perform System.out.println statements (Great!)

Has anyone succesfully done anything similar?

Thanks in advance

Rob
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon May 23, 2005 4:50 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Inserts are pieces of text that are inserted into placeholders in your error message - like "Missing database table &1 in statement &2"

The error message is saying that it is looking in the resources it has and can't find a message key of 'SQLE'. If that key is valid in your ResourceBundle, then it is not able to find your ResourceBundle for some reason.

This use of ResourceBundles is not documented very well in the Broker documentation - presumably because it is a java standard practice and not any different for Broker.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
hallmark
PostPosted: Tue May 24, 2005 8:32 am    Post subject: ResourceBundles Reply with quote

Voyager

Joined: 10 Mar 2005
Posts: 76

Has anyone else implemented the constructor for MbUserException and referred to a ResourceBundle. How was it done?

Thanks

Rob
Back to top
View user's profile Send private message
hallmark
PostPosted: Tue May 24, 2005 8:37 am    Post subject: Thanks Reply with quote

Voyager

Joined: 10 Mar 2005
Posts: 76

Sorry Jeff, I meant to say thanks for your response.
Thanks

Rob
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue May 24, 2005 8:52 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

What is the name of your resource bundle property file?

http://java.sun.com/j2se/1.4.2/docs/api/java/util/ResourceBundle.html#getBundle(java.lang.String,%20java.util.Locale,%20java.lang.ClassLoader)
should give you some hints about where it should be in your plugin jar file.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Java User defined extensions and Exception Handling
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.