2014-12-09 60 views
0
Exception in thread "main" org.apache.poi.POIXMLException: ] 

java.lang.reflect.InvocationTargetException 
    at org.apache.poi.xssf.usermodel.XSSFFactory.createDocumentPart(XSSFFactory.java:61) 
    at org.apache.poi.POIXMLDocumentPart.read(POIXMLDocumentPart.java:277) 
    at org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:186) 
    at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:189) 
    at com.simplecode.excel.XlstoCSV.xls(XlstoCSV.java:26) 
    at com.simplecode.excel.XlstoCSV.main(XlstoCSV.java:86) 

Caused by: java.lang.reflect.InvocationTargetException 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) 
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) 
    at java.lang.reflect.Constructor.newInstance(Constructor.java:501) 
    at org.apache.poi.xssf.usermodel.XSSFFactory.createDocumentPart(XSSFFactory.java:59) 

... 5 more 

Caused by: java.lang.NoClassDefFoundError: javax/xml/stream/XMLStreamException 
    at java.lang.Class.getDeclaredMethods0(Native Method) 
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2395) 
    at java.lang.Class.getMethod0(Class.java:2642) 
    at java.lang.Class.getMethod(Class.java:1579) 
    at org.apache.xmlbeans.XmlBeans.buildMethod(XmlBeans.java:174) 
    at org.apache.xmlbeans.XmlBeans.buildNodeMethod(XmlBeans.java:195) 
    at org.apache.xmlbeans.XmlBeans.buildNodeToCursorMethod(XmlBeans.java:232) 
    at org.apache.xmlbeans.XmlBeans.<clinit>(XmlBeans.java:131) 
    at org.openxmlformats.schemas.drawingml.x2006.main.ThemeDocument$Factory.parse(Unknown Source) 
    at org.apache.poi.xssf.model.ThemesTable.<init>(ThemesTable.java:39) 
+0

由於您是新用戶在這裏,讓我告訴你,如果你用這裏的任何答案讓你的問題的解決方案,那麼你應該接受這個答案讓別人知道你什麼工作。要接受答案,只需點擊您想接受的答案左側的右邊的勾號。 – gprathour 2014-12-09 12:00:05

回答

2

你是缺少包括javax.xml.stream.jar文件。

Download from here

+0

現在即時獲取此異常在線程「主」java.lang.OutOfMemoryError:Java堆空間 – 2014-12-09 12:03:09

+0

當我將一些kb的xlsx轉換爲csv它得到轉換,但當我嘗試3 MB大小的文件它給這個異常 – 2014-12-09 12:04:51

+0

這將是因爲無論你在做什麼都會消耗大量的記憶。你應該發佈你的Java代碼,讓我們知道爲什麼會發生這種情況。並且可能會作爲一個新問題發佈,因爲此問題已解決,您可以接受它。 – gprathour 2014-12-09 12:05:48

相關問題