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 » Error while calling JAVA Methods from ESQL

Post new topic  Reply to topic
 Error while calling JAVA Methods from ESQL « View previous topic :: View next topic » 
Author Message
Vgowda
PostPosted: Mon Jan 30, 2012 4:51 am    Post subject: Error while calling JAVA Methods from ESQL Reply with quote

Acolyte

Joined: 11 Dec 2007
Posts: 61
Location: Bengaluru

Hi,
I am calling 2 Java methods from ESQL as shown below.

ESQL Code
Quote:
DECLARE Var1 CHARACTER 'Request Message received ';
DECLARE Var2 CHARACTER 'Request Msg is ';
DECLARE MsgRef REFERENCE TO InputRoot.SOAP."Body";
CALL Proc1(Var1);
CALL Proc2(Var2,MsgRef);

CREATE PROCEDURE Proc1( IN P1 CHARACTER )
LANGUAGE JAVA
EXTERNAL NAME "com.Logger.debug";

CREATE PROCEDURE Proc2 (IN Var1 CHARACTER, INOUT Var2 REFERENCE )
LANGUAGE JAVA
EXTERNAL NAME "com.Logger.debug";


But getting below mentioned error for 2nd Method. If i invoke the same methods from javacompute node it works fine.

Error
Quote:
RecoverableException
File:CHARACTER:F:\build\S610_P\src\DataFlowEngine\ImbRdl\ImbRdlRoutine.cpp
Line:INTEGER:1153
Function:CHARACTER:SqlRoutine::resolveExternalJavaParameters
Type:CHARACTER:ComIbmComputeNode
Name:CHARACTER:SampleInfo#FCMComposite_1_5
Label:CHARACTER:SampleInfo.Capture
Catalog:CHARACTER:BIPv610
Severity:INTEGER:3
Number:INTEGER:3202
Text:CHARACTER:An error occured whilst trying to locate a Java Class / method
Insert
Type:INTEGER:5
Text:CHARACTER:.SampleInfo_Compute.myProc2
Insert
Type:INTEGER:5
Text:CHARACTER:1.2
Insert
Type:INTEGER:5
Text:CHARACTER:com.Logger.debug
Insert
Type:INTEGER:5
Text:CHARACTER:myProc2
RecoverableException
File:CHARACTER:F:\build\S610_P\src\DataFlowEngine\ImbRdl\ImbRdlExternalJava.cpp
Line:INTEGER:1115
Function:CHARACTER:ESQL2JavaMethodResolver::decodeReturnStatus
Type:CHARACTER:
Name:CHARACTER:
Label:CHARACTER:
Catalog:CHARACTER:BIPv610
Severity:INTEGER:3
Number:INTEGER:2946
Text:CHARACTER:The Java method could not be found
Insert
Type:INTEGER:5
Text:CHARACTER:com.Logger.debug


I am using WMB 6.1.0.10 runtime and 6.1.0.3 toolkit.
Any thoughts on this would be helpful.
_________________
Regards
Vinay
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Jan 30, 2012 5:15 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

What java type maps to a REFERENCE variable?
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Mon Jan 30, 2012 5:39 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

Also, you seem to be attempting to call Logger directly without initializing it first. This would not work properly, even in Java.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
Esa
PostPosted: Mon Jan 30, 2012 5:52 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

lancelotlinc wrote:
Also, you seem to be attempting to call Logger directly without initializing it first. This would not work properly, even in Java.


Of course it would. The java methods referenced by an ESQL wrapper are supposed to be static.

Maybe that's what is wrong with the OP's scenario?

Well, we cannot tell because he has not posted his java code.
Back to top
View user's profile Send private message
Vgowda
PostPosted: Mon Jan 30, 2012 6:20 am    Post subject: Reply with quote

Acolyte

Joined: 11 Dec 2007
Posts: 61
Location: Bengaluru

Found the error. It was because i was using INOUT reference, and in java code i was using like this

Quote:
public static void debug2(String message, MbElement Msg)


changed the reference to IN and it worked. For INOUT i should have created the reference like

Quote:
public static void debug2(String message, MbElement[] Msg)


Silly mistake from myside.

thank you all for the response
_________________
Regards
Vinay
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Jan 30, 2012 6:33 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Vgowda wrote:
Found the error. It was because i was using INOUT reference, and in java code i was using like this

Quote:
public static void debug2(String message, MbElement Msg)

So when you reviewed the rules for mapping between ESQL and Java types, you found the issue?

I wonder if that's why I asked what the mapping for the type you specified was.
Back to top
View user's profile Send private message
Vgowda
PostPosted: Mon Jan 30, 2012 8:16 pm    Post subject: Reply with quote

Acolyte

Joined: 11 Dec 2007
Posts: 61
Location: Bengaluru

mqjeff : Yes, while reviewing the mapping table found the issue.
_________________
Regards
Vinay
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Error while calling JAVA Methods 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.