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 » Calling a Java method ( with CSD4 )

Post new topic  Reply to topic Goto page 1, 2  Next
 Calling a Java method ( with CSD4 ) « View previous topic :: View next topic » 
Author Message
GMetcalf
PostPosted: Fri Sep 24, 2004 12:35 am    Post subject: Calling a Java method ( with CSD4 ) Reply with quote

Newbie

Joined: 24 Sep 2004
Posts: 5

Has anyone got the external Java methods working in CSD4 ?

The docs make it look very straight forward and in my eyes would unlock the true potentional of of WBIBM.

Heres what im trying ....

CREATE PROCEDURE MyJava( IN P1 INTEGER, OUT P2 INTEGER, INOUT P3 INTEGER )
RETURNS INTEGER
LANGUAGE JAVA
EXTERNAL NAME "com.ibm.broker.tools.AddOne.add";

Which genrates a syntax error ( Despite being copied form the manual ! )

Any help greatly appreciated

G
Back to top
View user's profile Send private message
mgk
PostPosted: Fri Sep 24, 2004 12:55 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Hi,

I have this working, and I can help you if you actually post what the error is, what your java code is, messages from the syslog / event log, etc...


Cheers,
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
GMetcalf
PostPosted: Fri Sep 24, 2004 1:04 am    Post subject: Reply with quote

Newbie

Joined: 24 Sep 2004
Posts: 5

Hi MGK

Cheers for the reply....

Its not even getting past the compile stage with the code posted... ( So its unlikley to be a setup issue, classpath etc... yet )

Code:
CREATE PROCEDURE MyJava( IN P1 INTEGER, OUT P2 INTEGER, INOUT P3 INTEGER )
RETURNS INTEGER
LANGUAGE JAVA
EXTERNAL NAME "com.ibm.broker.tools.AddOne.add";


I get a Syntax error ( red cross symbol ) on the "RETURNS INTEGER" line and the usual spuriouse "valid options include : identified ATTACH BEGIN CALL.... etc "

Can you post a sample of the code you are using please ?
Are you defining the procedure in a separate file ? or part of a compute noe for example ?

Cheers

G
Back to top
View user's profile Send private message
mgk
PostPosted: Fri Sep 24, 2004 1:36 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Hi,

I tried the code you posted with a straight cut and paste into a compute node, and into a seperate file, and I get no syntax errors. This leads me to think your tooling is not updated properly as part of the CSD install for some reason. Can you check you really have CSD 4 installed? The help about box in the tooling says "Version: 5.0.4
Build id: 20040715_1621" for me, what does it say for you?

Cheers,

MGK
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Sat Sep 25, 2004 6:08 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Did you follow all the necessary steps after upgrading your Toolkit, post-installation?

There's at least two things that need to be done, as far as I remember. One is that you have to rebuild all of your projects. The other is that you have to make sure that the tooling actually got updated properly, by rebuilding your metadata folder in your workspace.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
GMetcalf
PostPosted: Sat Sep 25, 2004 12:33 pm    Post subject: Reply with quote

Newbie

Joined: 24 Sep 2004
Posts: 5

Hi MGK

Looks like CSD4 didnt actually apply ( grrr ). I ended up uninstalling the toolkit and starting from sctratch ( hence the late reply - sorry )

Thanks for your help.

Kind Regards

G
Back to top
View user's profile Send private message
Mohit Gupta
PostPosted: Mon Nov 01, 2004 11:05 pm    Post subject: Calling Java Method from WBIMB(CSD$) Reply with quote

Apprentice

Joined: 16 Sep 2004
Posts: 34

Hi,

I am getting the following errors while deploying the ESQL to the broker

=======================================
BIP9304S Unable to locate message 'BIP2943' in resource bundle 'BIPv500' (resource bundle not available

BIP2498E: (.TLMPOCMessageFlow_ProcessMessage.myProc1, 1.2) : Illegal third argument to SUBSTRING function.

The third argument must be an integer giving a valid length for the substring.

Correct the syntax of the expression and redeploy the message flow.


BIP4121E: Syntax error in SQL statements in compute node 'TLMPOCMessageFlow.'.

The configuration of compute node TLMPOCMessageFlow. failed due to errors in the SQL expression. See the following messages for details of the error. The statement text was ' CREATE SCHEMA "" CREATE COMPUTE MODULE TLMPOCMessageFlow_ProcessMessage CREATE FUNCTION Main() RETURNS BOOLEAN BEGIN -- CALL CopyMessageHeaders(); CALL CopyEntireMessage(); RETURN TRUE; END; CREATE PROCEDURE CopyMessageHeaders() BEGIN DECLARE I INTEGER 1; DECLARE J INTEGER CARDINALITY(InputRoot.*[]); WHILE I < J DO SET OutputRoot.*[I] = InputRoot.*[I]; SET I = I + 1; END WHILE; END; CREATE PROCEDURE CopyEntireMessage() BEGIN SET OutputRoot = InputRoot; PASSTHRU('exec proc_BCLogDetail_ins ' || InputRoot.MQMD.PutApplName|| ','22''); DECLARE I INTEGER 1; DECLARE J INTEGER CARDINALITY(InputRoot.MRM.Row[]); WHILE I <= J DO SET OutputRoot.MRM.Row[I].BaseCcy = InputRoot.MRM.Row[I].ForeignCcy; SET OutputRoot.MRM.Row[I].ForeignCcy = InputRoot.MRM.Row[I].BaseCcy; SET OutputRoot.MRM.Row[I].Rate = ROUND(1 / (InputRoot.MRM.Row[I].Rate) , 5); SET I = I + 1; END WHILE; PASSTHRU('exec proc_BCLogDetail_ins ' || InputRoot.MQMD.PutApplName|| ','23''); PASSTHRU('exec proc_BCLogDetail_ins ' || InputRoot.MQMD.PutApplName|| ','95''); PASSTHRU('exec proc_BCLog_upd ' || InputRoot.MQMD.PutApplName|| ','95''); DECLARE intReturnVar3 INTEGER; CALL myProc1() INTO intReturnVar3; END; CREATE PROCEDURE myProc1() RETURNS INTEGER LANGUAGE JAVA EXTERNAL NAME "MyJNIClass.importDocument"; END MODULE; '.

The next error message will give specific details of where the error occurred in the statement text. Check the correct syntax for compute node SQL statements in the WebSphere MQ Integrator publications. Correct the statements configuring the node and redeploy the configuration.

============================================

Can anybody help me out...

Regards,
Mohit Gupta
Back to top
View user's profile Send private message
Mohit Gupta
PostPosted: Tue Nov 02, 2004 4:32 am    Post subject: Calling java method(Urgent Help!!) Reply with quote

Apprentice

Joined: 16 Sep 2004
Posts: 34

In addition to it these are the following errors in my Event Viewer

( WBRK_BROKER.TLMPOC ) The Java Method 'MyJNIClass.importDocument' could not be found as its containing class could not be found in the broker classpath

The specified Java Method 'MyJNIClass.importDocument' 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.

Examine and correct the SQL program.

( WBRK_BROKER.TLMPOC ) (.TLMPOCMessageFlow_ProcessMessage.importDocument, 1.2) : An error occured whilst trying to resolve the Java class / method 'MyJNIClass.importDocument' referred to by the routine 'importDocument'.

Further messages will explain the error in more detail.

Correct the Java error and redeploy the message flow.

==============================================

I have done everything from unistalling the toolkit ,checked also the build id it shows version 5.0.4 20040715_1621 ..this error comes when i try to deploy the esql on the broker.

Its very very urgent

Pls let me know if anybody have successfully achieved
Regards
Mohit
Back to top
View user's profile Send private message
mgk
PostPosted: Tue Nov 02, 2004 5:21 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Hi,
The substring message looks like either you have the wrong message catalog, or there is an error in the catalog itself. If this error continues you should raise a PMR for this issue.

With regards to the Java "class not found" error, the problem is exactly what it says: You do not seem to have fully followed the manual for CREATE PROCEDURE when it explains how to add the Java class (which contains the method you wish to CALL) to the classpath. The class MyJNIClass must be added to the classpath before this can work. Please reread this section and try again.

Just a note about your passthru usage: You should NOT be hardcoding the string to pass to the DB in the way you are doing it. You should be using parameter markers instead ( '?' ). Please see the passthru manual entry for an example.

Regards,
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
jfluitsm
PostPosted: Sat Mar 05, 2005 8:56 am    Post subject: Reply with quote

Disciple

Joined: 24 Feb 2002
Posts: 160
Location: The Netherlands

I got the same messages in my event log.
The application log in the event viewer showed the correct messages.
I found that the message catalog in the toolkit is outdated, although the toolkit shows the correct level 5.0.4 (on 2 different computers).
Copying the BIPv500.properties from <installdir>\messages to <installdir>\evtoolkit\eclipse\plugins\com.ibm.etools.mft.config_5.0.2 solved the problem.
_________________
Jan Fluitsma

IBM Certified Solution Designer WebSphere MQ V6
IBM Certified Solution Developer WebSphere Message Broker V6
Back to top
View user's profile Send private message Send e-mail
nmaddisetti
PostPosted: Thu Mar 31, 2005 10:09 am    Post subject: Reply with quote

Centurion

Joined: 06 Oct 2004
Posts: 145

Hi
can we call two java methods those are in same class
Thanks
nmaddisetti
Back to top
View user's profile Send private message
EddieA
PostPosted: Thu Mar 31, 2005 12:21 pm    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

Think about, or look up, how the EXTERNAL NAME value is constructed, and you will answer your own question.

Cheers,
_________________
Eddie Atherton
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
kiran_mvr
PostPosted: Fri Apr 01, 2005 12:12 pm    Post subject: Reply with quote

Apprentice

Joined: 12 Dec 2004
Posts: 35

Hi
i was able to call two methods and we can call any no of methods
Thanks
nmaddisetti
_________________
Kiran_manny
Back to top
View user's profile Send private message
kiran_mvr
PostPosted: Mon Apr 04, 2005 8:37 am    Post subject: Problems with calling a Java Method in ESQL Reply with quote

Apprentice

Joined: 12 Dec 2004
Posts: 35

Hai ..
I tried to call a Java Method using ESQL . its of this sort..

CALL DBInsert() INTO insertStatus;

CREATE PROCEDURE DBInsert()
RETURNS CHAR
LANGUAGE JAVA
EXTERNAL NAME "Insert.FileReadAndDBInsert";

Insert is the java program name,FileReadAndDBInsert is the method in it.
I specifed the location of the Java file in classpath also. But iam getting the
following ERRORS

Error:The following error occurred during execution of an Java Method call.
Error:Java Exception calling CallStaticObjectMethodA.
Error:java.lang.NoClassDefFoundError: java/sql/Savepoint

PLZ help me with this!! very urgent...
_________________
Kiran_manny
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Apr 04, 2005 9:28 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

This is the third place you've placed this same question.

You have a classpath issue.
_________________
I am *not* the model of the modern major general.
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 » Calling a Java method ( with CSD4 )
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.