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 » Unable to pass env ref to java from esql as INOUT parameter

Post new topic  Reply to topic
 Unable to pass env ref to java from esql as INOUT parameter « View previous topic :: View next topic » 
Author Message
makeithappen
PostPosted: Sun Dec 18, 2016 4:59 pm    Post subject: Unable to pass env ref to java from esql as INOUT parameter Reply with quote

Newbie

Joined: 18 Dec 2016
Posts: 1

Hi,
when i am trying to pass env reference as INOUT parameter to java method from esql ,I am getting below java reference error.

BIP3202E: (com.xxx.xx.test.getData, 1.1) : An error occurred when trying to resolve the Java class or method 'com.xxx.xx.test.DataUtil.getData' which is referred to by the routine 'getData'.

if i pass env reference as IN parameter it works fine for me. but as i want to store some data in env in java method,i have to pass as INOUT.
Please help me to understand what i am missing here .



SET stat= getData("test",envRef);

ESQL Function
---------------------
CREATE FUNCTION getData(IN test CHARACTER,INOUT envRef REFERENCE)
RETURNS CHARACTER
LANGUAGE JAVA
EXTERNAL NAME "com.xxx.xx.test.DataUtil.getData";

--Java Method

public static String getData(String test,MbElement envRef){
try {
return "OK";
} catch (Exception mbExp) {
return mbExp.getMessage();

}
}
}



Thanks in advance!!
Back to top
View user's profile Send private message
adubya
PostPosted: Mon Dec 19, 2016 12:22 am    Post subject: Reply with quote

Partisan

Joined: 25 Aug 2011
Posts: 377
Location: GU12, UK

For an INOUT parameter, the Java type must be an array.

http://www.ibm.com/support/knowledgecenter/SSMKHH_9.0.0/com.ibm.etools.mft.doc/ak04960_.htm

Try

Code:

public static String getData(String test,MbElement[] envRef){
try {   
return "OK";
} catch (Exception mbExp) {
return mbExp.getMessage();

}
}   
}

_________________
Independent Middleware Consultant
andy@knownentity.com
Back to top
View user's profile Send private message Send e-mail
fjb_saper
PostPosted: Mon Dec 19, 2016 2:36 am    Post subject: Reply with quote

Grand High Poobah

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

Why do you need to pass the parameter as INOUT ? You are not changing the pointer. You are changing the tree structure beneath the pointer.
Just pass the parameter as IN and see what the change does to the structure...
_________________
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 » Unable to pass env ref to java from esql as INOUT parameter
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.