Author |
Message
|
j.f.sorge |
Posted: Wed Sep 30, 2009 10:30 pm Post subject: Throwing MbUserException in WMB 6.0 vs 6.1 |
|
|
Master
Joined: 27 Feb 2008 Posts: 218
|
Hello!
Right now I'm still on WMB 6.0 but thinking about an upgrade to WMB 6.1. The error handler catches specific error number which are thrown in ESQL
Code: |
CREATE PROCEDURE ThrowDisqualify ( )
BEGIN
THROW USER EXCEPTION MESSAGE 2999 VALUES('message will be disqualified');
END; |
and Java
Code: |
throw new MbUserException("MyClass", "throwDisqualify", "BIPv600", "2999", "message will be disqualified", null); |
.
This works really fine and error handler can detect the error with number 2999 and does the specific behaviour.
When I use the same code in WMB 6.1 error handler does not detect the error number (as it is not the correct CATALOG / should be "BIPv610" instead of "BIPv600") and throws an Execption with number 4394. This means "Java exception: <insert_1>; thrown from class name: <insert_2>, method name: <insert_3>, file: <insert_4>, line: <insert_5>; trace text: <insert_6>; resource bundle: <insert_7>; key: <insert_8>; inserts(optional): <insert_9>, <insert_10>, <insert_11>, <insert_12>, <insert_13>, <insert_14>, <insert_15>, <insert_16>, <insert_17>, <insert_18>" and does not work as expected.
Is there any chance to set the correct catalog information in Java for WMB version automatically (setting the value to "" or null does not work)? The only way I know to get the version information is ESQL by calling
(see http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r1m0/index.jsp?topic=/com.ibm.etools.mft.doc/ak04897_.htm)
Thanks in advance! _________________ IBM Certified Solution Designer - WebSphere MQ V6.0
IBM Certified Solution Developer - WebSphere Message Broker V6.0
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
findingsolution |
Posted: Tue Jul 27, 2010 11:24 pm Post subject: |
|
|
Novice
Joined: 27 Jul 2010 Posts: 11
|
We too are facing same problem . We really need help.... any help is appreciated |
|
Back to top |
|
 |
j.f.sorge |
Posted: Wed Jul 28, 2010 2:25 am Post subject: |
|
|
Master
Joined: 27 Feb 2008 Posts: 218
|
I did a work-around which stores the version of MessageBroker runtime within Environment.
This value will be used when throwing UserExceptions to set the correct catalog. _________________ IBM Certified Solution Designer - WebSphere MQ V6.0
IBM Certified Solution Developer - WebSphere Message Broker V6.0
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
mqmatt |
Posted: Wed Jul 28, 2010 2:40 am Post subject: |
|
|
 Grand Master
Joined: 04 Aug 2004 Posts: 1213 Location: Hursley, UK
|
AFAIK there's no easy way to update this.
As of WMB V7, the catalog name has been made version independent ("BIPmsgs") so no longer needs changing each release. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Jul 28, 2010 2:53 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
|
Back to top |
|
 |
findingsolution |
Posted: Thu Jul 29, 2010 7:14 am Post subject: |
|
|
Novice
Joined: 27 Jul 2010 Posts: 11
|
can any one suggest .. how to throw a user defined java Exception which works excatly like
THROW USER EXCEPTION MESSAGE 15;
i am using throw new MbUserException("MyClass", "throwDisqualify", "BIPv600", "15", "message will be disqualified", null);
above statment in java but no use i am notr getting the desired result .. please suggest it is very urgent |
|
Back to top |
|
 |
j.f.sorge |
Posted: Thu Jul 29, 2010 7:28 am Post subject: |
|
|
Master
Joined: 27 Feb 2008 Posts: 218
|
findingsolution wrote: |
but can any one suggest .. how to throw a user defined java Exception which works excatly like
THROW USER EXCEPTION MESSAGE 15;
i am using throw new MbUserException("MyClass", "throwDisqualify", "BIPv600", "15", "message will be disqualified", null);
above statment in java but no use .. please suggest it is very urgent |
The Java code will only work (in WMB 6.1) if you set the correct catalog (which is BIPv610 for WMB 6.1). I set this value by storing the broker version within ESQL code (as you can only access the version information there) within the Environment and get this value later when I'm in the Java code. _________________ IBM Certified Solution Designer - WebSphere MQ V6.0
IBM Certified Solution Developer - WebSphere Message Broker V6.0
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
findingsolution |
Posted: Thu Jul 29, 2010 7:33 am Post subject: |
|
|
Novice
Joined: 27 Jul 2010 Posts: 11
|
Thank you Very much .. but in project we should not use the ESQL code ..
Is their any way to set using a Java compute node.. |
|
Back to top |
|
 |
j.f.sorge |
Posted: Thu Jul 29, 2010 7:45 am Post subject: |
|
|
Master
Joined: 27 Feb 2008 Posts: 218
|
findingsolution wrote: |
Thank you Very much .. but in project we should not use the ESQL code ..
Is their any way to set using a Java compute node.. |
You can probably set the value by using a UserDefinedProperty and setting its value before deploying the message flow... _________________ IBM Certified Solution Designer - WebSphere MQ V6.0
IBM Certified Solution Developer - WebSphere Message Broker V6.0
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
findingsolution |
Posted: Thu Jul 29, 2010 8:27 am Post subject: |
|
|
Novice
Joined: 27 Jul 2010 Posts: 11
|
thank you very much for your response
do we need to set it in ESQL again .. can we do it in Java ...
can you please provide an example .. or the syntax how to set it ..
i am first time working on this techonlogy .. please help me to solve this.. |
|
Back to top |
|
 |
Amitha |
Posted: Thu Jul 29, 2010 9:07 am Post subject: |
|
|
 Voyager
Joined: 20 Nov 2009 Posts: 80 Location: Newyork
|
|
Back to top |
|
 |
j.f.sorge |
Posted: Thu Jul 29, 2010 10:59 pm Post subject: |
|
|
Master
Joined: 27 Feb 2008 Posts: 218
|
|
Back to top |
|
 |
Amitha |
Posted: Fri Jul 30, 2010 4:11 am Post subject: |
|
|
 Voyager
Joined: 20 Nov 2009 Posts: 80 Location: Newyork
|
I wonder why brokerversion properties is not available in java. I hope mqmatt is listening to this. |
|
Back to top |
|
 |
rekarm01 |
Posted: Sat Jul 31, 2010 2:13 pm Post subject: Re: Throwing MbUserException in WMB 6.0 vs 6.1 |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
mqmatt wrote: |
AFAIK there's no easy way to update this. |
There is the default-access class method com.ibm.broker.plugin.MbService.getBrokerMessageSource(), that might be useful.
mqmatt wrote: |
As of WMB V7, the catalog name has been made version independent ("BIPmsgs") so no longer needs changing each release. |
Another option is to create a user-defined catalog for use with MbUserExceptions, and not worry about the broker catalogs. |
|
Back to top |
|
 |
j.f.sorge |
Posted: Sun Aug 01, 2010 10:37 pm Post subject: Re: Throwing MbUserException in WMB 6.0 vs 6.1 |
|
|
Master
Joined: 27 Feb 2008 Posts: 218
|
rekarm01 wrote: |
mqmatt wrote: |
AFAIK there's no easy way to update this. |
There is the default-access class method com.ibm.broker.plugin.MbService.getBrokerMessageSource(), that might be useful. |
Is this the cause why this method is not mentioned in JavaDoc? _________________ IBM Certified Solution Designer - WebSphere MQ V6.0
IBM Certified Solution Developer - WebSphere Message Broker V6.0
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
|