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 » Problem Calling JAVA METHOD from ESQL with REFERENCE as IN

Post new topic  Reply to topic
 Problem Calling JAVA METHOD from ESQL with REFERENCE as IN « View previous topic :: View next topic » 
Author Message
CuriCAT
PostPosted: Mon Oct 13, 2008 8:58 am    Post subject: Problem Calling JAVA METHOD from ESQL with REFERENCE as IN Reply with quote

Voyager

Joined: 26 Sep 2006
Posts: 82

I am facing a problem when I call a java routing from ESQL only when when I pass REFERENCE as a Parameter.

please find the detail below.

Broker Toolkit 6.0.2:

If I make a reference in ESQL to JAVA method with string as input parameter I don't see any error.


Example 1:

at ESQL:

CREATE PROCEDURE hashValue2 (
IN Value CHAR
)
RETURNS CHAR
LANGUAGE JAVA
EXTERNAL NAME "com.xyz.CommonJavaFunctions_JavaCompute.hashValue2";

at java :

public static String hashValue2(String value) {

return "";
}


EXAMPLE2 : If I use REFERENCE as an input parameter I am getting error Unable to locate a class definition named "com.xyz.CommonJavaFunctions_JavaCompute" in the project or a referenced project.

at ESQL

CREATE PROCEDURE hashValue2 (
IN Value REFERENCE
)
RETURNS CHAR
LANGUAGE JAVA
EXTERNAL NAME "com.xyz.CommonJavaFunctions_JavaCompute.hashValue2";

at java :

public static String hashValue2(MbElement value) {

return "";
}


have any one faced similer problem? please let me know if you got any suggestions, i am sure it is not related to PROJECT references or classpath, it doesn't give any error if I change the parameter type, I greatly appreciate your help.
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Esa
PostPosted: Tue Oct 14, 2008 7:12 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

I think you can only pass references to java as INOUT parameters.
Back to top
View user's profile Send private message
broker_new
PostPosted: Tue Oct 14, 2008 7:59 am    Post subject: Reply with quote

Yatiri

Joined: 30 Nov 2006
Posts: 614
Location: Washington DC

Try something like this,it is working code in Prod ..
(remember getCorrelationIDInBytes method is in JCN and the jar file is deployed on broker).


CREATE PROCEDURE getCorrelationIDInBytes(IN MESSAGEID CHARACTER)
RETURNS BLOB
LANGUAGE JAVA
EXTERNAL NAME "com.ibm.util.broker.BrokerUtilities.getCorrelationIDInBytes";


public static byte[] getCorrelationIDInBytes(String id){
return id.getBytes();
}
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Oct 14, 2008 8:01 am    Post subject: Reply with quote

Grand High Poobah

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

String.getBytes() will not return a byte representation of the correlId being passed as String! It will return a byte representation of that String. Completely different!
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mgk
PostPosted: Tue Oct 14, 2008 8:36 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Hi.

This is incorrect:
Quote:
I think you can only pass references to java as INOUT parameters


You can do what you are trying to do, and your signatures look correct. So did the java class really get deployed when you changed the signature? I would have both methods in the same class as a test (each with a slightly different name) and try calling both methods, one after another from ESQL. If this still fails, when maybe you should raise a PMR as IN REFERENCEs to a java method should work.

Regards
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.


Last edited by mgk on Tue Oct 14, 2008 1:36 pm; edited 1 time in total
Back to top
View user's profile Send private message
CuriCAT
PostPosted: Tue Oct 14, 2008 9:21 am    Post subject: Reply with quote

Voyager

Joined: 26 Sep 2006
Posts: 82

Thanks for you response guys!

mgk is RIGHT.

I have used such methods in my previous project ... REFERENCE as just IN (input) parameter.

I got the problem resolved.. its because of project reference only.

I have checked out project from StarTeam and .project was read only file. the java project reference which I made wasn't get updated.

Thanks for the alternative ideas..
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
mqjeff
PostPosted: Tue Oct 14, 2008 9:30 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

CuriCAT wrote:
mgk is RIGHT.


He usually is.
Back to top
View user's profile Send private message
mgk
PostPosted: Tue Oct 14, 2008 1:38 pm    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Quote:
He usually is.


Thanks

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
kuladeep.dairy
PostPosted: Tue Nov 17, 2009 12:06 am    Post subject: getCorrelationIDInBytes method is in JCN and the jar file is Reply with quote

Apprentice

Joined: 11 Jul 2009
Posts: 38

Hi
can you please let know where i can find this jar. i am not able to find it.
Many Thanks..
Back to top
View user's profile Send private message
gauravg
PostPosted: Wed May 11, 2016 2:28 am    Post subject: Reply with quote

Novice

Joined: 12 Jan 2016
Posts: 14

Hi,

I am facing similar issue when try to pass reference to Java method. In IIB 10.0.0.2, I have prepared one Application which is referencing one java project. This java project contains method with parameter as MbElement.

When I try to deploy the bar file (containing this application and its dependency), I got same error : signature mismatch).
When I change signature to simple datatype as String, then it gets deployed successfully.

I have tried with IN, INOUT both, but still its giving same error when passing reference. There is no read only marked in .project file in java project.

Please suggest.

Thanks
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed May 11, 2016 3:00 am    Post subject: Reply with quote

Grand High Poobah

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

gauravg wrote:
Hi,

I am facing similar issue when try to pass reference to Java method. In IIB 10.0.0.2, I have prepared one Application which is referencing one java project. This java project contains method with parameter as MbElement.

When I try to deploy the bar file (containing this application and its dependency), I got same error : signature mismatch).
When I change signature to simple datatype as String, then it gets deployed successfully.

I have tried with IN, INOUT both, but still its giving same error when passing reference. There is no read only marked in .project file in java project.

Please suggest.

Thanks


Delete the .class files and jar files relating to the java project to force a new build when creating the bar file. See if it works after deploying that bar files. With java projects I would not try the hot deploy but remover and add the application again. If you try a hot deploy there are chances that your java project does not get the correct new version... especially if the methods have the same name...
_________________
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 » Problem Calling JAVA METHOD from ESQL with REFERENCE as IN
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.