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 » Throwing MbUserException in WMB 6.0 vs 6.1

Post new topic  Reply to topic Goto page 1, 2  Next
 Throwing MbUserException in WMB 6.0 vs 6.1 « View previous topic :: View next topic » 
Author Message
j.f.sorge
PostPosted: Wed Sep 30, 2009 10:30 pm    Post subject: Throwing MbUserException in WMB 6.0 vs 6.1 Reply with quote

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
Code:
SQL.BrokerVersion
(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
View user's profile Send private message
findingsolution
PostPosted: Tue Jul 27, 2010 11:24 pm    Post subject: Reply with quote

Novice

Joined: 27 Jul 2010
Posts: 11

We too are facing same problem . We really need help.... any help is appreciated
Back to top
View user's profile Send private message
j.f.sorge
PostPosted: Wed Jul 28, 2010 2:25 am    Post subject: Reply with quote

Master

Joined: 27 Feb 2008
Posts: 218

I did a work-around which stores the version of MessageBroker runtime within Environment.
Code:
SQL.BrokerVersion
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
View user's profile Send private message
mqmatt
PostPosted: Wed Jul 28, 2010 2:40 am    Post subject: Reply with quote

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
View user's profile Send private message
mqjeff
PostPosted: Wed Jul 28, 2010 2:53 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

mqmatt wrote:
As of WMB V7, the catalog name has been made version independent ("BIPmsgs") so no longer needs changing each release.


The documentation disagrees..
http://publib.boulder.ibm.com/infocenter/wmbhelp/v7r0m0/index.jsp?topic=/com.ibm.etools.mft.doc/ak05150_.htm

Of course the documentation is also wrong in this case. There are significantly more search hits for 'BIPv700' than there are for 'BIPmsgs'.
Back to top
View user's profile Send private message
findingsolution
PostPosted: Thu Jul 29, 2010 7:14 am    Post subject: Reply with quote

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
View user's profile Send private message
j.f.sorge
PostPosted: Thu Jul 29, 2010 7:28 am    Post subject: Reply with quote

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
View user's profile Send private message
findingsolution
PostPosted: Thu Jul 29, 2010 7:33 am    Post subject: Reply with quote

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
View user's profile Send private message
j.f.sorge
PostPosted: Thu Jul 29, 2010 7:45 am    Post subject: Reply with quote

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
View user's profile Send private message
findingsolution
PostPosted: Thu Jul 29, 2010 8:27 am    Post subject: Reply with quote

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
View user's profile Send private message
Amitha
PostPosted: Thu Jul 29, 2010 9:07 am    Post subject: Reply with quote

Voyager

Joined: 20 Nov 2009
Posts: 80
Location: Newyork

Quote:

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 get the Broker properties from Java.

http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r1m0/topic/com.ibm.etools.mft.doc/ac30210_.htm
Back to top
View user's profile Send private message Send e-mail
j.f.sorge
PostPosted: Thu Jul 29, 2010 10:59 pm    Post subject: Reply with quote

Master

Joined: 27 Feb 2008
Posts: 218

Amitha wrote:
You can get the Broker properties from Java.

http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r1m0/topic/com.ibm.etools.mft.doc/ac30210_.htm

But you cannot get the BrokerVersion from Javahttp://publib.boulder.ibm.com/infocenter/wmbhelp/v6r1m0/index.jsp?topic=/com.ibm.etools.mft.doc/ak04897_.htm

Define UDP in msgflow, set a value and use
Code:
getUserDefinedAttribute(String name)
method in JCN to get the value.
_________________
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
View user's profile Send private message
Amitha
PostPosted: Fri Jul 30, 2010 4:11 am    Post subject: Reply with quote

Voyager

Joined: 20 Nov 2009
Posts: 80
Location: Newyork

Quote:
But you cannot get the BrokerVersion from Java http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r1m0/index.jsp?topic=/com.ibm.etools.mft.doc/ak04897_.htm


I wonder why brokerversion properties is not available in java. I hope mqmatt is listening to this.
Back to top
View user's profile Send private message Send e-mail
rekarm01
PostPosted: Sat Jul 31, 2010 2:13 pm    Post subject: Re: Throwing MbUserException in WMB 6.0 vs 6.1 Reply with quote

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
View user's profile Send private message
j.f.sorge
PostPosted: Sun Aug 01, 2010 10:37 pm    Post subject: Re: Throwing MbUserException in WMB 6.0 vs 6.1 Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Throwing MbUserException in WMB 6.0 vs 6.1
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.