×
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 Greg,
All of the error messages I've seen so far indicate that the error is a
null object reference (i.e. an RPG O=Object field that's set to *NULL --
or zero). Would you concur with this?
Then when I step into the "wwPOIFS = new_POIFSFileSystem(wwFile);"
statement the program terminates.
If the error occurs on that line.... well, wwFile is the only input
into new_POIFSFileSystem. So if you're getting a null object reference
via JNI, then there's really only two possibilities... either the
prototype for new_POIFSFileSystem() is wrong, or the wwFile variable is
set to NULL.
Trouble is... I know there are quite a few people using this routine --
including myself -- and I don't get the error your describing. That
implies that the prototype is correct!
But, you say that when you debug it, wwFile is not null... So I'm at a
loss.
Just to be absolutely sure, you might try changing the monitor block in
hssf_open() to look like this:
monitor;
wwStr = new_String(peFilename);
if wwStr <> *null;
wwFile = new_FileInputStream(wwStr);
if wwFile <> *null;
wwPOIFS = new_POIFSFileSystem(wwFile);
if wwPOIFS <> *null;
wwBook = new_HSSFWorkbookFromPOIFS(wwPOIFS);
endif;
endif;
endif;
on-error 301;
// catch error and proceed.
endmon;
That should guarantee that none of the inputs are null. The other
possibility is that POFSFileSystem() is crashing due to a bug in the
actual Java code. If that's the case, you should be able to send me
your spreadsheet (off-list) and I should be able to reproduce the same
problem you're having.
Regarding debugging the Java code... I guess you could do that. I
would suspect that you'd need to download the source code for POI and
re-compile it with a debugging view. Then you should be able to debug
it via WDSC. Barbara Morris has posted information on how to debug RPG
calling JAva to this mailing list in the past. You might try searching
the archives for tips.
As an Amazon Associate we earn from qualifying purchases.