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 » Issue while calling java function from ESQL using BLOB data

Post new topic  Reply to topic
 Issue while calling java function from ESQL using BLOB data « View previous topic :: View next topic » 
Author Message
vanshul
PostPosted: Tue Jun 10, 2014 10:05 pm    Post subject: Issue while calling java function from ESQL using BLOB data Reply with quote

Novice

Joined: 06 Jun 2008
Posts: 13

Hi,

My java function is this

package com.bnsf.mech.da.cmrs.appservice;
public class ComponentResolverAPI {
public static byte[] improveTrainMatch(byte[] inputMsgBytes) {
return inputMsgBytes;
}
}

I am calling it using esql like this

DECLARE inCCSID, inEncoding INT;
SET inCCSID = CAST(InputRoot.Properties.CodedCharSetId AS INT);
SET inEncoding = CAST(InputRoot.Properties.Encoding AS INT);
DECLARE messageOutBlob BLOB;
DECLARE messageBlob BLOB ;
SET messageBlob = ASBITSTREAM(InputRoot.JSON.Data);
SET messageOutBlob = improveTrainMatch(messageBlob);

CREATE LASTCHILD OF OutputRoot DOMAIN('JSON')
PARSE(messageOutBlob ENCODING inEncoding CCSID inCCSID FORMAT 'JSON' OPTIONS RootBitStream) ;


CREATE FUNCTION improveTrainMatch( IN messageBlobIn BLOB)
RETURNS BLOB
LANGUAGE JAVA
EXTERNAL NAME "com.bnsf.mech.da.cmrs.appservice.ComponentResolverAPI.improveTrainMatch";

Issue is I can see the BLOB getting created from JSON when I use ASBITSTREAM but when I enter the java function, value is blank.

Any leads would be appreciated.
Back to top
View user's profile Send private message
Esa
PostPosted: Wed Jun 11, 2014 12:25 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

I cannot check this because the Knowledge Centers are not working at the moment, but shouldn't a BLOB parameters be handled as byte[][] in java?

Search this forum.
Back to top
View user's profile Send private message
McueMart
PostPosted: Wed Jun 11, 2014 1:08 am    Post subject: Reply with quote

Chevalier

Joined: 29 Nov 2011
Posts: 490
Location: UK...somewhere

Take a user trace too see if it sheds any light on the issue.

@Esa - I would have expected a 'method not found exception' if it was related to the method signature mismatch.
Back to top
View user's profile Send private message
ghoshly
PostPosted: Fri Jun 13, 2014 3:00 am    Post subject: ESQL / Java comparison Reply with quote

Partisan

Joined: 10 Jan 2008
Posts: 333

IN Type - byte []
OUT / INOUT type - byte[][]

http://www-01.ibm.com/support/knowledgecenter/api/content/SSKM8N_8.0.0/com.ibm.etools.mft.doc/ak20708_.htm
Back to top
View user's profile Send private message
Esa
PostPosted: Fri Jun 13, 2014 3:12 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

Yes.

The problem with the table -- when it comes to the OP's problem -- is that it doesn't tell if the the corresponding RETURNS datatatype for BLOB is byte[] or byte[][]... But that should be quite easy to test.

@vanshul: have you run user trace?
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 » Issue while calling java function from ESQL using BLOB data
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.