Justin - been there just recently and it will not work.
I am using XMLSERVICE with PHP and many calls to RPG programs and service
program procedures.
To get around this I used data queues to a monitor (never ending program)
that receives requests on the data queue, calls the processes that use java
and returns the results.
In hind site I am actually happy that that I had to do it this way. There
are generally hundreds of XMLSERVICE jobs running on the system, (one site
had over 14000) and if everyone of those started a JVM that is a huge
amount of resource requirement.
The data queue process is working very well and will scale if needed where
I can start multiple monitors to process requests.
If you need more information please let me know.
Don Brown
From: "Justin Taylor" <JUSTIN@xxxxxxxxxxxxx>
To: "OpenSource-Midrange. com (opensource@xxxxxxxxxxxx)"
<opensource@xxxxxxxxxxxx>
Date: 03/10/2018 07:20 AM
Subject: [IBMiOSS] XMLSERVICE, RPGLE & Java error
Sent by: "OpenSource" <opensource-bounces@xxxxxxxxxxxx>
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
--
This is the IBMi Open Source Roundtable (OpenSource) mailing list
To post a message email: OpenSource@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit:
https://lists.midrange.com/mailman/listinfo/opensource
or email: OpenSource-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at
https://archive.midrange.com/opensource.
______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit
http://www.symanteccloud.com
______________________________________________________________________
As an Amazon Associate we earn from qualifying purchases.