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



Eric,

RPG procedure CRPGPROC (this is likely an RPG routine that someone in your shop wrote -- or something you got from a vendor?) is trying to call a Java method (similar in concept to a subprocedure) named getSheetAt.

It is expecting that method to accept an integer as a parameter (I), and it is expecting it to return a Java object of a particular class (the class.name got cut off in the message, but starts with "org/apache/poi/ss/usermodel.SHEET")

Can you look at CRPGPROC and see what's going on?   The fact that "SHEET" is in all capital letters seems VERY VERY suspicious to me... I'm thinking someone changed it to uppercase when it was meant to be mixed case.  Also, verify that the prototype for getSheetAt is written correctly, check its parameters, return value, et al, against the documentation for the POI version you're working with.

Just a little bit of looking around and troubleshooting should make it easy to solve a problem like this.

-SK



On 9/6/23 11:35 AM, eric bothes wrote:
getting the following and not sure why. the path looks correct and the jar file has the class workbook with a method getsheetat.

Message . . . . :   Java exception received when calling Java method.
Cause . . . . . :   RPG procedure CRPGPROC in program DONNA/PRCFILES received
  Java exception "java.lang.NoSuchMethodError:
org/apache/poi/ss/usermodel/Workbook.getSheetAt(I)Lorg/apache/poi/ss/us"
  when calling method "getSheetAt" with signature
  "(I)Lorg.apache.poi.ss.usermodel.SHEET;" in class
  "org.apache.poi.ss.usermodel.Workbook".


os: 7.1
java version "1.6.0"
Java(TM) SE Runtime Environment (build pap6460_26sr5ifix-20130304_01(SR5+IV37419))
IBM J9 VM (build 2.6, JRE 1.6.0 OS/400 ppc64-64 Compressed References jvmap6460_26sr5-20130207_01_cr (JIT enabled, AOT enabled)
J9VM - R26_Java626_SR5_20130204_0851_B137148
JIT  - r11.b03_20130131_32403
GC   - R26_Java626_SR5_20130204_0851_B137148_CMPRSS
J9CL - 20130204_137148)
JCL  - 20130303_02

classpath:

/home/donna/poi/poi.jar:
/home/donna/poi/poi-ooxml.jar:
/home/donna/poi/dom4j.jar:
/home/donna/poi/xbean.jar:
/home/donna/poi/jsr.jar:
/home/donna/poi/poi-ooxml-schemas.jar:
/home/donna/poi/poi-scratchpad.jar

jar files:
/home/donna/poi/dom4j.jar
/home/donna/poi/jsr.jar
/home/donna/poi/poi.jar
/home/donna/poi/poi-ooxml-schemas.jar
/home/donna/poi/poi-scratchpad.jar
/home/donna/poi/xbean.jar

code:
d SSWORKBOOK_GETSHEETAT...
d                 pr                  LIKE(SSSheet)
d                                     EXTPROC(*JAVA:WORKBOOK_CLASS
d                                     :'getSheetAt')
d SHEETIDX                            LIKE(JINT) VALUE

d WORKBOOK_CLASS  c 'org.apache.poi.ss.usermodel.-
d Workbook'

SSWorkbook=ss_open(%trim(filename));                  --- works fine. pointer not null.
SSSheet = SsWorkbook_getSheetAt(SSWorkbook : 0  );   --- bombs




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.