|
Try: D convert Pr O Extproc( *Java : D 'conversionTest' : D *Constructor ) D O Class( *Java : D 'java.io.File' ) D 10I 0 Value Gary Guthrie meovino@estes-express.com wrote: > > > Mike, you've got to read the whole "RPG and Java" section in the ILE RPG > > Programmer's Guide. > > Barbara, I HAVE read the whole section. Perhaps you missed the beginning > of the thread, but I do not claim to be an RPG programmer nor do I claim > to be a Java programmer. I just got stuck with trying to make this work. > > I have re-read the chapter several times, and it looks as if I need to call > the Java method passing an instance parameter as the first parm. > Unfortunately, the book does not appear to give any examples of calling a > non-static method that does not return a value. The method is defined as > follows: > > public class conversionTest > { > > public conversionTest(File f, int format) > > The prototype now looks like this: > > D Class1 C 'conversionTest' > * java method > D convert PR ExtProc(*JAVA: > D Class1:'conversionTest') > * method parameters > D f O Class(*JAVA:'java.io.File') > D Const > D format 10I 0 Value > > And I have defined an object called obj. However, I don't really know what > to define it as. I have tried both > > D obj S O Class(*JAVA:Class1) > > and > > D obj S O Class(*JAVA:'java.lang.Object') > > Both compile; neither works. > > I am calling the method as follows: > > c callp convert(obj:fFile:format) > > And every time I do, I get a NoSuchMethodError. But the signature it tells > me it can't find ("(Ljava.io.File;I)V" in class "conversionTest") looks > like the signature I find when I run javap on conversionTest > ((Ljava/io/File;I)V). I'm sure I'm being dense here, but I genuinely don't > know what I'm doing wrong. > > Mike E. > > _______________________________________________ > This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list > To post a message email: RPG400-L@midrange.com > To subscribe, unsubscribe, or change list options, > visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l > or email: RPG400-L-request@midrange.com > Before posting, please take a moment to review the archives > at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
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.