× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hello

I am having problems calling a JAVA program from an RPG program that I
have
Written
I am wondering if anyone can share some insight with me.
Here is the scenario. I was tasked with creating an RPG program (that
calls a
Java Program) that would be called via an exit point in our software
package.

The RPG program runs just fine if I run it interactively and it also run
fine
The first time it is called via the exit point - but the second
execution it
fails with the error:

Message . . . . : Java exception received when calling Java method.

Cause . . . . . : RPG procedure JVA001R1 in program CWMUINH/JVA001R1

received Java exception "java.lang.UnknownError:" when calling method
"main"
with signature "([Ljava.lang.String;)V" in class "JCombine".


My code:
DJCombine PR STATIC

D EXTPROC(

D *JAVA:

D 'JCombine':

D 'main')

D O CLASS(*JAVA:'java.lang.String')

D DIM(4)

D CONST


beginObjGroup (JNIENV_p : 10000);



monitor;

args(1) = String$new(ProdTest);

args(2) = String$new(@COMP);

args(3) = String$new(@TCst#);

args(4) = String$new(@SCst#);

JCombine(args);

on-error;

Exsr $Error;

endmon;



endObjGroup (JNIENV_p);





Jim Muehe





Programmer/Analyst

jmuehe@xxxxxxxxxxxxxxxx

719-272-2618




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.