getSheetList method throws the following exception: ClassNotFoundException: org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTSheetsImpl$1SheetList at org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTSheetsImpl.getSheetList ... Checking the decompiled code of the class CTSheetsImpl it is possible to see a strange dependency: import org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTSheetsImpl.1SheetList; That inner class is not there. It looks like the method getSheetList was refactored in version 1.6 and a big part of the code moved to that class that I can not find.
poi-ooxml-schemas jar only has the main org.openxmlformats classes - use ooxml-schema instead - it has all the org.openxmlformats classes. Better still, try POI 4.0.0. [1] https://mvnrepository.com/artifact/org.apache.poi/ooxml-schemas/1.3
Created attachment 36151 [details] screenshot of the problematic class What I mean is that in poi-ooxml-schemas jar, the class CTSheetsImpl is not correct and its inner class 1SheetList does not exist in both versions 3.16 and 3.17. Also, I have just checked 4.0 version and it has the problem. ooxml-schema 1.3 contains an older implementation of the CTSheetsImpl which is equivalent to the one that you can find in poi-ooxml-schemas 3.15 with is correct.
There is an ooxml-schemas 1.4 which was released with poi 4.0.0. ooxml-schemas 1.3 is the jar that poi-ooxml-schemas-3.17 is built from. getSheetList can be replaced with getSheetArray - the latter method does not need the inner class 1SheetList. Apache POI code base only seems to use getSheetArray - from a grep that I've just done.
Cool, getSheetArray can solve my problem. Nevertheless, getSheetList method is not correct and that problem should be fixed or the method removed because it is going to be continuously raising that exception.
org.openxmlformats classes are not part of the POI public API. They are merely implementation classes. If you insist on using them directly, that is up to you - but the POI team are not providing any guarantees for them. And to reiterate, the 1SheetList inner class is in ooxml-schemas jar.
With #56854 we've replaced most (all?) calls to get*List(). As we have now control over XmlBeans, we could do ... a) ... nothing, because it's in the full schema b) ... remove the ...List() calls on the schema generation, which probably breaks a lot of user code - so this is a no-go c) ... analyze and fix the performance problems in XmlBeans, but that wouldn't include the inner classes d) ... do some reflection magic in the ooxml-lite generation and call all the *List() methods, which makes the ooxml-lite purpose futile e) ... create test cases for selected *List() methods - which one should we call and why not the others? so choosing a) or c) doesn't lead to code changes in POI, therefore WONTFIX is correct.