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




All,

I'm trying to prototype one of the POI methods in rpg. I'm having trouble
with POIFSFileSystem.

In java, this works:

java.io.FileInputStream fis = null;
fis = new FileInputStream("C:/template/POI-template.xls");

org.apache.poi.poifs.filesystem.POIFSFileSystem poifs = null;
poifs = new org.apache.poi.poifs.filesystem.POIFSFileSystem(fis);

But it RPG it doesn't.

In RPG, I prototyped POIFSFileSystem like this:

D jPOIFSFile...
D pr O extproc(*java
D
:'org.apache.poi.poifs.filesystem-
D .POIFSFileSystem'
D :*CONSTRUCTOR)
D class(*java
D
:'org.apache.poi.poifs.filesystem-
D .POIFSFileSystem')
D arg0 O class(*java
D :'java.io.FileInputStream')
D
D inFile s O class(*JAVA
D :'java.io.FileInputStream')

// filename is a String object
inFile = jInFile(filename);
poifs = jPOIFSFile(inFile);

When I run it, I get this error:

Message . . . . : Java exception received when calling Java method.
Cause . . . . . : RPG procedure TEST_TEMPL in program QGPL/POITEST
received Java exception "java.lang.NoSuchMethodError: <init>" when
calling
method "<init>" with signature "(Ljava.io.FileInputStream;)V" in class
"org.apache.poi.poifs.filesystem.POIFSFileSystem".
I ran the qsh command that the help suggests:
qsh cmd('javap -s org.apache.poi.poifs.filesystem.POIFSFileSystem')

Which returns (in part) this:
public
org.apache.poi.poifs.filesystem.POIFSFileSystem(java.io.InputStream);
throws java/io/IOException
Signature: (Ljava/io/InputStream;)V

java.io.InputStream is an abstract class.

Anyone have any ideas what I need to do for this to work?

Thanks,

Phil





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.