Bug 57176

Summary: CTDefinedNamesImpl.getDefinedNameList causes ClassNotFoundException
Product: POI Reporter: Jan <jan.plesingr>
Component: XSSFAssignee: POI Developers List <dev>
Status: RESOLVED WORKSFORME    
Severity: normal    
Priority: P2    
Version: 3.10-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: All   
Attachments: File to reproduce the 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