For future reference, I've created a project that demonstrates this error.
Justin-E-Taylor/IBM-i-Python-to-RPG-Java<https://github.com/Justin-E-Taylor/IBM-i-Python-to-RPG-Java.git>



From: Justin Taylor
Sent: Tuesday, October 02, 2018 2:21 PM
To: OpenSource-Midrange. com (opensource@xxxxxxxxxxxx) <opensource@xxxxxxxxxxxx>
Subject: XMLSERVICE, RPGLE & Java error

I'm trying to use XMLSERVICE/itoolkit to call RPG that calls Java. My JVM crashes immediately on startup. Has anyone seen this/have a work-around? I have created a simple test case that can replicate the issue.

RPGLE:
//--------------------------------------------------
// Procedure name: stringConstructor
// Purpose: Java String constructor
// Returns: Java String object
// Parameter: bytes => RPG character variable
//--------------------------------------------------
Dcl-pr stringConstructor object(*java : 'java.lang.String')
extProc(*java : 'java.lang.String' : *constructor) ;
bytes varchar(9999) const ;
End-pr;

//----------------------------------------------------------------------
// stand-alone fields
//----------------------------------------------------------------------
Dcl-s javaString object(*java : 'java.lang.String') ;

//-----------------------------------------------------------------------

javaString = stringConstructor('A');
javaString = *null;

*inLR = *on;
Return;


Python:
from itoolkit import iCmd, iData, iPgm, iToolKit
from itoolkit.db2.idb2call import iDB2Call

itransport = iDB2Call()
itool = iToolKit()

itool.add(iPgm('my_key', 'STRJVM', {'lib':'QGPL'}))

itool.call(itransport)


Cross-post to MIDRANGE-L & Ryver.

TIA

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.