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



Hi Pete,

You forgot to tell it which *object* in which to call the method.

You've already told it which class, and the method name... but as you know, an object is an instance of a class that's created at run time, and each object has it's own copy of the methods and fields... so Java needs to know which *object* (not just which class) contains the specific method you want to call.

In RPG, you always pass the object name as the first parameter to the prototype. (You *don't* want to code the object as a parameter on the D-specs -- it's there implicitly. But you *do* have to pass it as the first parameter when you call it.)

That's the reason you're getting the 'the call passed fewer parameters than the prototype' error. Your prototype may have 9 parameters declared, but there's an implicit first parameter indicating the object to call. So you should be passing 10 parameters, and you're only passing 9.

It's also why you're getting 'type and attributes of parameter 9 don't match the prototype'. The system is expecting the 9th parameter to be your prOutFormat parameter (which is an object of type jString). However, you've passed peCompile (which is an indicator) for that parameter. So they don't match.

Anyway, the fix will be to pass an object that has been instantiated from the com.valadd.report.engine.Generator class as the first parameter:

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

ALSO... I just noticed that you've repeated a dot in the EXTPROC by mistake, when you split the line. Right now you have coded 'com.valadd.report.engine..Generator' (notice the two periods before generator.) You split the name across two lines, but put the dot on both lines...

Hope that makes sense... it's hard to explain.

Pete Helgren wrote:
I have a java program that I'd like to wrap with RPG. This is the first attempt I have made at something like this (including placing prototypes in a separate member and /copying them in). So there may because something obvious here that my ignorance is covering. When I compile the module, I get the following (V5R3M0):

A d d i t i o n a l D i a g n o s t i c M e s s a g e s Msg id Sv Statement Message text *RNF7535 30 000181 The type and attributes of parameter 9 do not match those
of the prototype. *RNF5406 30 000178 The call passed fewer parameters than the prototype
indicates are required.
I know what it is saying but looking at my code and the /copy member I don't see the mismatch.

Here is the relevant /copy:

*--------------------------------------------------------
*
* RPG Wrapper for RRGenerator_iPrintReport
*
*--------------------------------------------------------
D rrg_iPrintReport...
D PR 1N
D prHost like(jString)
D prLibList like(jString)
D prUserID like(jString)
D prPassword like(jString)
D prReportName like(jString)
D prReportOut like(jString)
D prRepParam like(jString)
D prOutFormat like(jString)
D prCompile 1N value
*+++++++++++++++++++++++++++++++++++
D RRGenerator_iPrintReport...
D PR 1N
D EXTPROC(*JAVA
D :'com.valadd.report.engine.-
D .Generator'
D :'iPrintReport')
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(jString)
D outputFormat like(jString)
D compileFirst 1N value
The call is here:

P rrg_iPrintReport...
P B EXPORT
D rrg_iPrintReport...
D PI 1N
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(jString)
D peOutFormat like(jString)
D peCompile 1N value
D success s 1N
D
D
/free

success = RRGenerator_iPrintReport(peHost: peLibList: peUserID: <-- Line 178
pePassword: peReportName:
peReportOut: peRepParam:
peOutFormat: peCompile); <---Line 181

return success;
/end-free

As I count/compare parameters and types it looks good to me. What I am I missing?

Thanks,

Pete




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.