× 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.



I have gotten the wrapper I have been working on to compile and I have created a CL wrapper to set the classpath and call a test program to run the RPG wrapped Java Class method, but I haven't been able to get beyond this error:

Message ID . . . . . . : RNX0301 Date sent . . . . . . : 04/16/08 Time sent . . . . . . : 21:32:30
Message . . . . : Java exception received when calling Java method.
Cause . . . . . : RPG procedure RRG_IPRINT in program RRG/RRG received Java
exception "java.lang.NoSuchMethodError: i5printReport" when calling method "i5printReport" with signature "(Ljava.lang.String;Ljava.lang.String;Ljava.lang.String;Ljava.lang.String;Lj
ava.lang.String;Ljava.lan" in class "com.valadd.report.engine.Generator".
Doing some research, it appears that the problem is likely that the RPG prototype that wraps the Java method doesn't have the same signature. That is, it appears not to be passing the same parameters the Java method expects. I ran javap -s on the class. This is what it shows:

public boolean i5printReport(java.lang.String, java.lang.String, java.lang.St
ring, java.lang.String, java.lang.String, java.lang.String, java.util.Map, ja
va.lang.String, boolean) throws java.io.IOException;
The RPG prototype is:

D RRGenerator_iPrintReport...
D PR N EXTPROC(*JAVA
D :'com.valadd.report.engine-
D .Generator'
D :'i5printReport')
D host like(jString)
D libraryList like(jString)
D userID like(jString)
D password like(jString)
D reportName like(jString)
D reportOutput like(jString)
D reportParam like(jMap)
D outputFormat like(jString)
D compFirst N value
I call it as follows:

P rrg_iPrintReport...
P B EXPORT
D rrg_iPrintReport...
D PI N
D peHost like(jString)
D peLibList like(jString)
D peUserID like(jString)
D pePassword like(jString)
D peReportName like(jString)
D peReportOut like(jString)
D peRepParam like(jMap)
D peOutFormat like(jString)
D peCompile N value
D success s N
D gen s like(RRGenerator)
D
/free

gen = new_RRGenerator();


success = RRGenerator_iPrintReport(gen: peHost:
peLibList: peUserID:
pePassword: peReportName:
peReportOut: peRepParam:
peOutFormat: peCompile);

return success;
/end-free
The

D jMap S O CLASS(*JAVA
D :'java.util.HashMap')
The error message is truncating the complete signature (which I am assuming is normal because of message length limitations) but looking at the code I don't see a mis-match unless it is one of those "hidden" things that I didn't know about or missed (like the missing object reference on my compile problem). I have searched the archives and it seems like I have covered the most common resolutions.

Any ideas? Should I post to the Java400 list ?

Thanks,

Pete Helgren


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.