Author |
Message
|
jeeth_m |
Posted: Fri Nov 14, 2008 4:23 am Post subject: calling java method form ESQL |
|
|
Voyager
Joined: 21 Jan 2002 Posts: 93
|
Hi,
I have a jar file which calls the BO server to get the report out of it. I want to call the methods in the jar file from ESQL.
Here is what i have done so far:
My ESQL code:
CREATE COMPUTE MODULE BoFlowTest_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
CALL CopyMessageHeaders();
-- CALL CopyEntireMessage();
DECLARE Result CHAR;
SET Result = TestBO();
SET OutputRoot.XML.BOResult.Result = Result;
RETURN TRUE;
END;
CREATE PROCEDURE TestBO()
RETURNS CHAR
LANGUAGE JAVA
EXTERNAL NAME "com.test.Sample.callBOService";
I have placed the jar file in
C:\Documents and Settings\All Users\Application Data\IBM\MQSI\shared-classes
jar file name is sample.jar
package name is com.test
Class name is Sample
Method is callBOService'
But when i run the flow, it says it cannot find the class.
Here is the error:
The Java Method ''com.test.Sample.callBOService'' could not be found as its containing class could not be found in the broker classpath
The specified Java Method ''com.test.Sample.callBOService'' belongs to a class that could not be found in the broker classpath. Ensure that the fully qualified name of the method is correct and that its containing class or jar file is in the broker classpath.
Any idea what i am doing wrong? |
|
Back to top |
|
 |
jeeth_m |
Posted: Fri Nov 14, 2008 7:48 am Post subject: |
|
|
Voyager
Joined: 21 Jan 2002 Posts: 93
|
The JAR file has some property files in it. Could it be a problem. I have tried calling jar file javacompute which is provided by WMB. It has worked fine. |
|
Back to top |
|
 |
Esa |
Posted: Mon Nov 17, 2008 11:23 am Post subject: |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
Did you restart the broker after placing the jar file in the working directory?
Also make sure that the method you call is a static one. |
|
Back to top |
|
 |
jeeth_m |
Posted: Wed Nov 26, 2008 4:17 am Post subject: |
|
|
Voyager
Joined: 21 Jan 2002 Posts: 93
|
Hi Esa,
i was on vacation. hence couldnt reply. We tried all you mentioned. still no luck. Which version of java is supported by WMB 6.0.0.7? any idea?
regards,
Jeeth |
|
Back to top |
|
 |
mqmatt |
Posted: Wed Nov 26, 2008 9:57 am Post subject: |
|
|
 Grand Master
Joined: 04 Aug 2004 Posts: 1213 Location: Hursley, UK
|
jeeth_m wrote: |
Which version of java is supported by WMB 6.0.0.7? any idea? |
Java 1.4.2 and Java 5. |
|
Back to top |
|
 |
golam1983 |
Posted: Thu Nov 27, 2008 5:12 am Post subject: |
|
|
 Apprentice
Joined: 27 Jun 2008 Posts: 35
|
I am not sure...did u tried deploying the jar in execution group where ur ESQL code is deployed. Just add the jar file along with ESQL and deploy... |
|
Back to top |
|
 |
jeeth_m |
Posted: Mon Dec 01, 2008 9:40 pm Post subject: |
|
|
Voyager
Joined: 21 Jan 2002 Posts: 93
|
Hi,
Jars were compiled using RSA. compiler version was 1.6 we changed it to 1.4 and it worked. It was a compiler problem but the error message showed unable to find classes.
Thanks much for all the input.
Regards,
Jeeth |
|
Back to top |
|
 |
|