Problem with RPG reading an Excel file with POI 3.8
Last Post 23 Nov 2012 07:02 AM by Alex R. 0 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Alex R
New Member
New Member

23 Nov 2012 07:02 AM

Hi all

I donwloaded the latest version of POI Release Brings Excel's XLSX Support to RPG (3.8) of Scott Klement and all work great!

I nedd only read a multiple Excel spreadsheet but if i try to read for the second time the same file from an interactive session, the program crashes with this  error:


Message . . . . :   Java exception received when calling Java method.       
 Cause . . . . . :   RPG procedure SS_OPEN in program mylib/HSSFR4 received
   Java exception "org.apache.poi.POIXMLException:                           
   java.lang.reflect.InvocationTargetException" when calling method "create" 
   with signature                                                            
   "(;);" in class  


Here a small code sample:

H DATEDIT(*YMD)                                                                 
     H DFTACTGRP(*NO)                                                                
     H OPTION(*SRCSTMT: *NODEBUGIO: *NOSHOWCPY)                                      
     H THREAD(*SERIALIZE)                                                            
     H BNDDIR('HSSF')                                                                
      * File specifications                                                          
    /copy hssf_h 

    D FileName            C                   Const('/filesinbound/Dummy.xlsx') 

    D book                    s                   like(SSWorkbook)    

    D count                   s             10I 0


     // Load an existing spreadsheet into memory        
     book = ss_open(FileName);                          
     if (book = *null);                                 
     // ERROR MSG

     count = SSWorkbook_getGetNumberOfSheets(book);    

    *inlr = *on;



 If I run the same program from a SBMJOB everithing works fine. I assume that is something realted to the garbage collector or with the JVM's memory and related threads... but I haven't any other ideas!

Any suggestions?


You are not authorized to post a reply.

Acceptable Use Policy