Bug 57176 - CTDefinedNamesImpl.getDefinedNameList causes ClassNotFoundException
Summary: CTDefinedNamesImpl.getDefinedNameList causes ClassNotFoundException
Status: RESOLVED WORKSFORME
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 3.10-FINAL
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-03 15:55 UTC by Jan
Modified: 2014-11-04 16:23 UTC (History)
0 users



Attachments
File to reproduce the bug (7.97 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2014-11-03 16:27 UTC, Jan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan 2014-11-03 15:55:51 UTC
/* my test code */

public class TestPOI {

	public static void main(String[] args) throws Exception {
		try (InputStream in = new FileInputStream("d:/tmp/TEST.xlsx")) {
			XSSFWorkbook workbook = new XSSFWorkbook(in);
			CTDefinedNames definedNames = workbook.getCTWorkbook().getDefinedNames();
			List<CTDefinedName> definedNameList = definedNames.getDefinedNameList();
			for (CTDefinedName defName : definedNameList) {
				System.out.println(defName.getName() + ": " + defName.getStringValue());
			}
		}
	}

}

/* result when calling definedNames.getDefinedNameList() */

Exception in thread "main" java.lang.NoClassDefFoundError: org/openxmlformats/schemas/spreadsheetml/x2006/main/impl/CTDefinedNamesImpl$1DefinedNameList
	at org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTDefinedNamesImpl.getDefinedNameList(Unknown Source)
	at test.poi.TestPOI.main(TestPOI.java:25)
Caused by: java.lang.ClassNotFoundException: org.openxmlformats.schemas.spreadsheetml.x2006.main.impl.CTDefinedNamesImpl$1DefinedNameList
	at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
Comment 1 Nick Burch 2014-11-03 16:19:04 UTC
Please see this FAQ Entry - http://poi.apache.org/faq.html#faq-N10025

We'll need a small test file showing the problem if we're to get that class into the minimal poi-ooxml-schemas jar
Comment 2 Jan 2014-11-03 16:27:53 UTC
Created attachment 32184 [details]
File to reproduce the bug
Comment 3 Jan 2014-11-03 16:28:30 UTC
test file - see attachment
Comment 4 Jan 2014-11-03 16:37:11 UTC
Thanks for the link/hint, I think it will be OK to use the full jar.
Comment 5 Nick Burch 2014-11-04 16:23:16 UTC
Unit test added in r1636634, which will see the class added to future small poi-ooxml-schemas jars