Bug 51308 - NoClassErrorFound when parse basic xslx file
Summary: NoClassErrorFound when parse basic xslx file
Status: RESOLVED INVALID
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 3.7-FINAL
Hardware: PC Windows XP
: P2 blocker (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-01 14:52 UTC by HAIJIANG
Modified: 2011-06-01 14:56 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description HAIJIANG 2011-06-01 14:52:03 UTC
The xslx is microsoft excel 2007 format, and only have one cell "Hello",
Code 1:
                XSSFWorkbook wb = new XSSFWorkbook(new FileInputStream("hello.xslx"));
		XSSFSheet sheet = wb.getSheetAt(0);
		System.out.println(sheet.getLastRowNum());

Code 2:

                Workbook wb = WorkbookFactory.create(new FileInputStream("hello.xslx"));
		Sheet sheet = wb.getSheetAt(0);
		System.out.println(sheet.getLastRowNum());
Error:
Caused by: java.lang.NoClassDefFoundError: org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTOneCellAnchor
	at java.lang.J9VMInternals.verifyImpl(Native Method)
	at java.lang.J9VMInternals.verify(J9VMInternals.java:59)
	at java.lang.J9VMInternals.initialize(J9VMInternals.java:120)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:67)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:521)
	at org.apache.xmlbeans.impl.schema.SchemaTypeImpl.createUnattachedNode(SchemaTypeImpl.java:1859)
	at org.apache.xmlbeans.impl.schema.SchemaTypeImpl.createTypeStoreUser(SchemaTypeImpl.java:1805)
	at org.apache.xmlbeans.impl.store.Xobj.setStableType(Xobj.java:1390)
	at org.apache.xmlbeans.impl.store.Cur.setType(Cur.java:2497)
	at org.apache.xmlbeans.impl.store.Cur.setType(Cur.java:2482)
	at org.apache.xmlbeans.impl.store.Locale.autoTypeDocument(Locale.java:352)
	at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:1273)
	at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:1257)
	at org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:345)
	at org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTDrawing$Factory.parse(Unknown Source)
	at org.apache.poi.xssf.usermodel.XSSFDrawing.<init>(XSSFDrawing.java:80)
	... 11 more
Comment 1 Nick Burch 2011-06-01 14:56:41 UTC
See the FAQ: http://poi.apache.org/faq.html#faq-N10025