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 » [solved] getting BIP2946E when calling Java method from ESQL

Post new topic  Reply to topic
 [solved] getting BIP2946E when calling Java method from ESQL « View previous topic :: View next topic » 
Author Message
j.f.sorge
PostPosted: Thu Dec 10, 2009 10:41 pm    Post subject: [solved] getting BIP2946E when calling Java method from ESQL Reply with quote

Master

Joined: 27 Feb 2008
Posts: 218

Hello!

I'm trying to call a static Java method from ESQL (as I want to get the data of the broker error message catalogs). The ESQL PROCEDURE is defined as
Code:
CREATE PROCEDURE javaStdGetDetailErrorInfoFromCatalog_getMessage(IN chCatalog CHARACTER, IN chErrorNumber CHARACTER, INOUT refInserts REFERENCE)
   RETURNS CHARACTER
   LANGUAGE JAVA
   EXTERNAL NAME "StdGetDetailErrorInfoFromCatalog.getMessage";
, the Java method has the following signature
Code:
public final class StdGetDetailErrorInfoFromCatalog {

   private StdGetDetailErrorInfoFromCatalog() {
      super();
   }

   public static String getMessage(String aCatalog, String aErrorNumber, MbMessage aRefEnvironment) {
      // code comes here
   }
   
}
and the call looks like
Code:
DECLARE refEx REFERENCE TO refEnvironment.Exception;
DECLARE chPrettyMsg   CHARACTER javaStdGetDetailErrorInfoFromCatalog_getMessage(CAST(refEx.Catalog AS CHARACTER), CAST(refEx.Number AS CHARACTER), refEx);
.
When this code is executed it always fails with an BIP2946E saying that there is no method with such a signature.

Do you have any ideas?

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


Last edited by j.f.sorge on Fri Dec 11, 2009 12:13 am; edited 1 time in total
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Dec 10, 2009 10:49 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Shouldn't your ref be an MbElement instead of an MbMessage?

You should as well check the method declaration and make sure you don't need any "boxing" with arrays...etc...

Obviously your defined java function does not match your call...
I would have thought that you would define (declare) a function in esql and not a procedure... but then again I don't believe there is anything wrong with defining a procedure... just check the differences in signatures...

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Gaya3
PostPosted: Thu Dec 10, 2009 10:49 pm    Post subject: Reply with quote

Jedi

Joined: 12 Sep 2006
Posts: 2493
Location: Boston, US

did you see this post

http://www.mqseries.net/phpBB2/viewtopic.php?p=108177&sid=e897eac6e85e278ced6a7897b333736c
_________________
Regards
Gayathri
-----------------------------------------------
Do Something Before you Die
Back to top
View user's profile Send private message
j.f.sorge
PostPosted: Thu Dec 10, 2009 10:57 pm    Post subject: Reply with quote

Master

Joined: 27 Feb 2008
Posts: 218

fjb_saper wrote:
Shouldn't your ref be an MbElement instead of an MbMessage?

You should as well check the method declaration and make sure you don't need any "boxing" with arrays...etc...

Obviously your defined java function does not match your call...
I would have thought that you would define (declare) a function in esql and not a procedure... but then again I don't believe there is anything wrong with defining a procedure... just check the differences in signatures...

Have fun

Thanks a lot for the hint - all the time I was thinking about using the correct datatype and double checkedhttp://publib.boulder.ibm.com/infocenter/wmbhelp/v6r1m0/index.jsp?topic=/com.ibm.etools.mft.doc/ak20708_.htm. But it seems that it have been too late. Will try again with MbElement.
_________________
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
j.f.sorge
PostPosted: Fri Dec 11, 2009 12:11 am    Post subject: if you're doing it correctly... Reply with quote

Master

Joined: 27 Feb 2008
Posts: 218

It works perfectly when using the correct type of Object - the MbElement. Thanks a lot!
_________________
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
fjb_saper
PostPosted: Fri Dec 11, 2009 12:23 am    Post subject: Re: if you're doing it correctly... Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

j.f.sorge wrote:
It works perfectly when using the correct type of Object - the MbElement. Thanks a lot!


You're Welcome
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » [solved] getting BIP2946E when calling Java method from ESQL
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.