Error on XLCRTDEMO

Scott Klement's open source interface to the POI HSSF/XSSF Spreadsheet Project for RPG Programmers. http://www.scottklement.com/poi/
Scott Klement
Site Admin
Posts: 945
Joined: Sun Jul 04, 2021 5:12 am

Re: Error on XLCRTDEMO

Post by Scott Klement »

XLCRTDEMO doesn't use xlparse.jar...

but if you want a copy, you can find it (together with the source for XLPARSER4 which uses it) here:
https://www.scottklement.com/poi/
HEB768
Posts: 6
Joined: Thu May 16, 2024 7:04 pm

Re: Error on XLCRTDEMO

Post by HEB768 »

wdwisser wrote: Fri Apr 29, 2022 11:52 am I didn't have my java path setup correctly. I had a friend help me out and now it works just fine... my mistake from learning as I go.
Hi, I have the same problem that you have.
Cause . . . . . : RPG procedure XLCRTDEMO in program POI36/XLCRTDEMO
received Java exception "java.lang.NoClassDefFoundError: org.apache.poi.xssf.usermodel.XSSFWorkbook" when calling method "<init>" with signature "()V" in class "org.apache.poi.xssf.usermodel.XSSFWorkbook".


I saw that you resolved your problem with you path Class. Can you share your path to see and compare with my code. Thank you !
wdwisser
Posts: 31
Joined: Tue Feb 15, 2022 5:12 pm

Re: Error on XLCRTDEMO

Post by wdwisser »

This is the CLASSPATH I am currently using, and it seems to work just fine.

ADDENVVAR ENVVAR(CLASSPATH) +
VALUE('/java/poi3.6/poi-3.6-20091214.jar+
:/java/poi3.6/poi-ooxml-3.6-20091214.jar+
:/java/poi3.6/poi-ooxml-schemas-3.6-20091214.jar+
:/java/dom4j/dom4j-1.6.1.jar+
:/java/xmlbeans/jsr173_1.0_api.jar+
:/java/xmlbeans/xmlbeans-2.5.0.jar') +
LEVEL(*JOB) +
REPLACE(*YES)
HEB768
Posts: 6
Joined: Thu May 16, 2024 7:04 pm

Re: Error on XLCRTDEMO

Post by HEB768 »

Hi

Thank you for your help. It's working now. I missed the xmlbeans-2.5.0 jar on my CLASSPATH and now everything is ok.
Badetia
Posts: 1
Joined: Wed Aug 07, 2024 9:58 am

Re: Error on XLCRTDEMO

Post by Badetia »

Where did you get all these jar file. I am getting jar files as you can find in attachment. would it be same or not?

[img][/img]
ADDENVVAR ENVVAR(CLASSPATH) +
VALUE('/java/poi3.6/poi-3.6-20091214.jar+
:/java/poi3.6/poi-ooxml-3.6-20091214.jar+
:/java/poi3.6/poi-ooxml-schemas-3.6-20091214.jar+
:/java/dom4j/dom4j-1.6.1.jar+
:/java/xmlbeans/jsr173_1.0_api.jar+
:/java/xmlbeans/xmlbeans-2.5.0.jar') +
LEVEL(*JOB) +
REPLACE(*YES)[/b]
Attachments
Screenshot 2024-08-07 153544.png
Screenshot 2024-08-07 153544.png (55.74 KiB) Viewed 120289 times
Scott Klement
Site Admin
Posts: 945
Joined: Sun Jul 04, 2021 5:12 am

Re: Error on XLCRTDEMO

Post by Scott Klement »

I wrote this stuff for a previous job many years ago. If you want to take the code and update it to work with 5.3.0 you certainly can, but it'll be up to you to identify the things that need to be change, change them, test them, etc.

I know it works with version 3.8.

You should be able to get any release from the POI website... I just went there now and clicked through and it took me to this URL. It looks like it has the poi-bin-3.8 (and poi-bin.3.6 versions) amongst other things...
https://archive.apache.org/dist/poi/release/bin/
Marz
Posts: 3
Joined: Wed Oct 22, 2025 4:02 pm

Re: Error on XLCRTDEMO

Post by Marz »

wdwisser wrote: Tue May 28, 2024 3:46 pm This is the CLASSPATH I am currently using, and it seems to work just fine.

ADDENVVAR ENVVAR(CLASSPATH) +
VALUE('/java/poi3.6/poi-3.6-20091214.jar+
:/java/poi3.6/poi-ooxml-3.6-20091214.jar+
:/java/poi3.6/poi-ooxml-schemas-3.6-20091214.jar+
:/java/dom4j/dom4j-1.6.1.jar+
:/java/xmlbeans/jsr173_1.0_api.jar+
:/java/xmlbeans/xmlbeans-2.5.0.jar') +
LEVEL(*JOB) +
REPLACE(*YES)
Hi, I've been struggling with the NoClassDefnFound error.
I have just the poi-3.6.jar, not the 20091214 version like you show there.
Here's my list so far:
- common-logging-1.1.jar
- dom4j-1.6.1.jar
- poi-3.6.jar
- poi-ooxml-3.6.jar
- poi-ooxml-schemas-3.6.jar
- xmlbeans-2.5.0.jar
Thank you.
Scott Klement
Site Admin
Posts: 945
Joined: Sun Jul 04, 2021 5:12 am

Re: Error on XLCRTDEMO

Post by Scott Klement »

Marz wrote: Wed Oct 22, 2025 4:20 pm Hi, I've been struggling with the NoClassDefnFound error.
Please post the actual message that shows which class isn't found. Also, please post exactly how your CLASSPATH is set so we can look for any potential problems with it.
Marz wrote: Wed Oct 22, 2025 4:20 pm I have just the poi-3.6.jar, not the 20091214 version like you show there.
Here's my list so far:
- common-logging-1.1.jar
- dom4j-1.6.1.jar
- poi-3.6.jar
- poi-ooxml-3.6.jar
- poi-ooxml-schemas-3.6.jar
- xmlbeans-2.5.0.jar
Thank you.
You can rename files to anything you wish. For example, you could rename "poi-3.6.jar" to "banana_riding_a_bicycle.jar", and it wouldn't matter, as long as you've put "banana_riding_a_bicycle.jar" correctly in your CLASSPATH. That said, when you download these files from Apache's website, they DO have dates in the filenames such asv "poi-3.6-20091214.jar". So you must have renamed them. Please just make certain that the contents of the .jar files are correct...

Assuming you have the correct files, please provide the following:
  • A screenshot of the directory showing the precise filenames
  • A screenshot showing the precise error message (full detail) you are getting, including which class isn't found.
  • A screenshot or code snippet showing exactly what your CLASSPATH is set to.
Thanks
Marz
Posts: 3
Joined: Wed Oct 22, 2025 4:02 pm

Re: Error on XLCRTDEMO

Post by Marz »

Hi Scott
For the JARs, in my IFS folder called POI36 I have both files - with and without dates. I downloaded them all from Maven repository.
The list:
- commons-collections-3.2.jar
- commons-compress-1.1.jar
- commons-logging-1.1.jar
- dom4j-1.6.1.jar
- jsr173_api-1.0.jar
- poi-3.6-20091214.jar
- poi-3.6.jar
- poi-ooxml-3.6-20091214.jar
- poi-ooxml-3.6.jar
- poi-ooxml-schemas-3.6-20091214.jar
- poi-ooxml-schemas-3.6.jar
- xmlbeans-2.5.0.jar

To set up the CLASSPATH, here's what I have in my CL. I'll use the files with dates this time.
ADDENVVAR ENVVAR(CLASSPATH) VALUE('+
/POI36/lib/poi-3.6-20091214.jar:+
/POI36/lib/poi-ooxml-3.6-20091214.jar:+
/POI36/lib/poi-ooxml-schemas-3.6-20091214.jar:+
/POI36/lib/xmlbeans-2.5.0.jar:+
/POI36/lib/dom4j-1.6.1.jar:+
/POI36/lib/jsr173_api-1.0.jar:+
/POI36/lib/commons-logging-1.1.jar:+
/POI36/lib/commons-collections-3.2.jar:+
/POI36/lib/commons-compress-1.1.jar') +
LEVEL(*JOB) REPLACE(*YES)

I know this is probably more JARs than what's needed. I have been playing with this for a few days.

After I ran the CL, I verified the CLASSPATH using WRKENVVAR cmd:
Name . . . . . . . . . : CLASSPATH

(for readability of the Value I put each JAR in a separate line here)

Value . . . . . . . . . : '/POI36/lib/poi-3.6-20091214.jar:
/POI36/lib/poi-ooxml-3.6-20091214.jar:
/POI36/lib/poi-ooxml-schemas-3.6-20091214.jar:
/POI36/lib/xmlbeans-2.5.0.jar:
/POI36/lib/dom4j-1.6.1.jar:
/POI36/lib/jsr173_api-1.0.jar:
/POI36/lib/commons-logging-1.1.jar:
/POI36/lib/commons-collections-3.2.jar:
/POI36/lib/commons-compress-1.1.jar'

Then, I called XLCRTDEMO in a debug mode, and I got the "Java exception received when calling Java method" error on this line:
book = new_XSSFWorkbook()

Additional Message Information.

Message ID . . . . . . : RNX0301 Severity . . . . . . . : 50
Message type . . . . . : Diagnostic
Date sent . . . . . . : 10/24/25 Time sent . . . . . . : 22:33:17

Message . . . . : Java exception received when calling Java method.
Cause . . . . . : RPG procedure XLCRTDEMO in program POI36/XLCRTDEMO
received Java exception "java.lang.NoClassDefFoundError:
org.apache.poi.xssf.usermodel.XSSFWorkbook" when calling method "<ini" with
signature "" in class "org.apache.poi.xssf.usermodel.XSSFWorkbook".

Thanks.
Post Reply