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



I have resolved some issues but now have a hard halt when trying to execute
ss_open().



I am trying to get my first program to work reading a spreadsheet using
Scott's examples and guidance.



I think I have it mostly correct but I am unable to debug through the HSSFR4
service program.



It fails on the ss_open(). Here is the error.



Additional Message Information





Message ID . . . . . . : RNX0301 Severity . . . . . . . : 50


Message type . . . . . : Escape


Date sent . . . . . . : 11/07/15 Time sent . . . . . . :
08:30:27




Message . . . . : Java exception received when calling Java method.


Cause . . . . . : RPG procedure SS_OPEN in program POI36/HSSFR4 received


Java exception "java.lang.NoClassDefFoundError:


org/apache/poi/ss/usermodel/WorkbookFactory" when calling method "create"


with signature


"(Ljava.io.InputStream;)Lorg.apache.poi.ss.usermodel.Workbook;" in class


"org.apache.poi.ss.usermodel.WorkbookFactory".


Recovery . . . : Contact the person responsible for program maintenance
to

determine the cause of the problem.


Technical description . . . . . . . . : If the exception indicates that
the

Java class was not found, ensure the class for the method is in the class


path. If the exception indicates that the Java method was not found,
check


More...

Press Enter to continue.






The is the code:





pgm



DCL VAR(&IFS_PATH) TYPE(*CHAR) LEN(256)
VALUE('"/ax_on_i/i_Brands and Prod +

Family/"')

dcl &return_Cod *char 2



chgvar &ifs_path '/ax_on_i/test/'



ADDENVVAR ENVVAR(CLASSPATH) +


VALUE('.:/Java/dom4j-1.6.1:/Java/poi-3.6:/Java/xmlbeans')

monmsg cpf0000



addlible poi36 *last

monmsg cpf0000



addlible xlparser4

monmsg cpf0000



call AX_XTRACT1 parm(&IFS_path &return_Cod)



if (&return_Cod = ' ') then(do)

call ax_brands1

enddo



rclrsc



RMVENVVAR ENVVAR(CLASSPATH)



endpgm







H*


H*


H* Program : AX_BRANDS2


H* Purpose : Read spreadsheet and write out data to file AX_BRANDS2.


H*


H*


H DFTACTGRP(*NO)


H OPTION(*SRCSTMT: *NODEBUGIO: *NOSHOWCPY)


H THREAD(*SERIALIZE)


H BNDDIR('HSSF')





/copy QSYSINC/QRPGLESRC,JNI


/copy POI36/qrpglesrc,hssf_h





D* book s like(HSSFWorkbook)


D book s like(XSSFWorkbook)


D sheet s like(HSSFSheet)


D row s like(HSSFRow)


D cell s like(HSSFCell)


D TempStr s like(jString)


D StrVal s 52A varying


D NumVal s 8F


D type s 10I 0





d content_rcd s 256a


D Spreadsheet_Name...


D s 256a


D Spreadsheet_rcd...


D s 1024a varying





D Full_Path s 256a


D email_message s 32767a varying


d crlf c x'0D25'
CR LF




D Error_Exists s n Inz(*off)


D End s 10i 0


D Start s 10i 0





D String_getBytes...


D pr 1024A varying


D extproc(*JAVA:


D 'java.lang.String':


D 'getBytes')





d validate_header_Row...


d pr





d get_spreadsheet_Name...


d pr





d Retrieve_Cell pr








/free





Exec Sql set option naming = *SYS,


commit = *none,


usrprf = *USER,


dynusrprf = *USER,


DATFMT = *ISO,


CloSqlCsr = *ENDMOD;





hssf_begin_object_group(100);





// Retrieve the xlsx file name from the file CONTENTS





get_Spreadsheet_Name();





//


// Load an existing spreadsheet into memory


//


// Full_Path = '/ax_on_i/i_Brands and Prod Family/' +


// %trim(Spreadsheet_Name);





// book = hssf_open(Full_Path);


monitor;


book = ss_open(Full_Path);


on-error;


*INLR = *on;


Return;


endmon;





sheet = hssf_getSheet(book: 'Active Products');





//


// Validate the header row


//





Validate_header_row();







TIA.



Darryl Freinkel | Assignment 400 Group, Inc.

Tel: 770.321.8562 ext 111 | 678.355.8562

2247 La Salle Dr, Marietta GA, 30062, USA | PO Box 72556, Marietta, GA
30007-2556

E-mail: <mailto:dfreinkel@xxxxxxxxxxxxxxxxx> dfreinkel@xxxxxxxxxxxxxxxxx

Web: <http://www.assignment400.com/> www.assignment400.com




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.