Bug 48572 - ClassNotFoundException: Missing class in poi-ooxml-schemas-3.6-20091214.jar
Summary: ClassNotFoundException: Missing class in poi-ooxml-schemas-3.6-20091214.jar
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 3.6-FINAL
Hardware: PC Windows Vista
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2010-01-19 07:17 UTC by Bernhard
Modified: 2010-03-15 06:42 UTC (History)
0 users

The affacted excel file (22.02 KB, application/octet-stream)
2010-01-21 01:41 UTC, Bernhard

Note You need to log in before you can comment on or make changes to this bug.
Description Bernhard 2010-01-19 07:17:31 UTC
When modifing an existing Excel file I always get the following error when saving it:

java.lang.ClassNotFoundException: org.openxmlformats.schemas.spreadsheetml.x2006.main.CTDxfs$1
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
        at java.lang.ClassLoader.loadClassInternal(Unknown Source)
        at org.openxmlformats.schemas.spreadsheetml.x2006.main.CTDxfs.<clinit>(Unknown Source)
        at org.openxmlformats.schemas.spreadsheetml.x2006.main.CTDxfs$Factory.newInstance(Unknown Source)
        at org.apache.poi.xssf.model.StylesTable.writeTo(StylesTable.java:362)
        at org.apache.poi.xssf.model.StylesTable.commit(StylesTable.java:377)
        at org.apache.poi.POIXMLDocumentPart.onSave(POIXMLDocumentPart.java:177)
        at org.apache.poi.POIXMLDocumentPart.onSave(POIXMLDocumentPart.java:181)
        at org.apache.poi.POIXMLDocument.write(POIXMLDocument.java:214)

It seems that the File org/openxmlformats/schemas/spreadsheetml/x2006/main/CTDxfs$1 is missing in the distribution of poi-ooxml-schemas-3.6-20091214.jar

Use ooxml-schemas-1.0.jar instead of poi-ooxml-schemas-3.6-20091214.jar
Comment 1 Yegor Kozlov 2010-01-20 23:02:39 UTC
Can you attach a sample .xlsx file that fires the exception? 

It looks like not all anonymous classes defined in CTDxfs are copied into poi-ooxml-schemas. A test file will be very helpful. 

Comment 2 Bernhard 2010-01-21 01:41:14 UTC
Created attachment 24874 [details]
The affacted excel file
Comment 3 Bernhard 2010-01-21 01:42:37 UTC
The file has been created with Excel 2003 and converted to xlsx using Excel 2007.
Comment 4 Yegor Kozlov 2010-01-24 05:15:22 UTC
Should be fixed in r902563

I improved the procedure that generates poi-ooxml-schemas to always copy all declared inner classes and interfaces, it should prevent such errors in future. 

Comment 5 Yegor Kozlov 2010-03-15 06:42:22 UTC
The problem was fixed in r902563 in Jan 2010.
Please try the latest build from trunk.

Nightly builds can be downloaded from http://encore.torchbox.com/poi-cvs-build/