I am not sure but it may have to do w how are u freeing the Java
objects?
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[
mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Jim Muehe
Sent: Thursday, April 19, 2007 1:05 PM
To: RPG400-L@xxxxxxxxxxxx
Subject: RPG calling JAVA
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
This message contains information proprietary to our company. It is intended to
be read only by the individual or entity named above or their designee.
Any distribution of this message or the information contained herein without
written permission from our company is strictly prohibited. If the reader of
this message is not the intended recipient or an agent responsible for
delivering it to the intended recipient, you are hereby notified that you have
received this document in error and that any review, dissemination,
distribution, or copying of this message is strictly prohibited. If you have
received this communication in error, please notify us immediately by e-mail,
and delete the original message.
As an Amazon Associate we earn from qualifying purchases.