Author |
Message
|
j.f.sorge |
Posted: Thu Dec 10, 2009 10:41 pm Post subject: [solved] getting BIP2946E when calling Java method from ESQL |
|
|
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 |
|
 |
fjb_saper |
Posted: Thu Dec 10, 2009 10:49 pm Post subject: |
|
|
 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 |
|
 |
Gaya3 |
Posted: Thu Dec 10, 2009 10:49 pm Post subject: |
|
|
 Jedi
Joined: 12 Sep 2006 Posts: 2493 Location: Boston, US
|
|
Back to top |
|
 |
j.f.sorge |
Posted: Thu Dec 10, 2009 10:57 pm Post subject: |
|
|
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 |
|
 |
j.f.sorge |
Posted: Fri Dec 11, 2009 12:11 am Post subject: if you're doing it correctly... |
|
|
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 |
|
 |
fjb_saper |
Posted: Fri Dec 11, 2009 12:23 am Post subject: Re: if you're doing it correctly... |
|
|
 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 |
|
 |
|