It's not a secret anymore!*
The moose likes Other JSE/JEE APIs and the fly likes Exception in thread Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Exception in thread "main" org.apache.poi.POIXMLException: java.lang.reflect.InvocationTargetExcepti" Watch "Exception in thread "main" org.apache.poi.POIXMLException: java.lang.reflect.InvocationTargetExcepti" New topic
Author

Exception in thread "main" org.apache.poi.POIXMLException: java.lang.reflect.InvocationTargetExcepti

bhaskar bolo
Greenhorn

Joined: Jul 28, 2011
Posts: 12
Hi

I am reading the data from xlsx using poi. While reading the Data from xlsx I got Exception in very beginig statement. The exception is in below. Can you please any one help me. Its very urgent.

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:256)
at org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:196)
at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:179)
at ReadXLSX.main(ReadXLSX.java:25)
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:494)
at org.apache.poi.xssf.usermodel.XSSFFactory.createDocumentPart(XSSFFactory.java:59)
... 4 more
Caused by: java.lang.NoClassDefFoundError: javax/xml/stream/XMLStreamException
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2365)
at java.lang.Class.getMethod0(Class.java:2611)
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.spreadsheetml.x2006.main.StyleSheetDocument$Factory.parse(Unknown Source)
at org.apache.poi.xssf.model.StylesTable.readFrom(StylesTable.java:102)
at org.apache.poi.xssf.model.StylesTable.<init>(StylesTable.java:91)
... 9 more


Thanks in Advance

Bhaskar


Vijay Tidake
Ranch Hand

Joined: Nov 04, 2008
Posts: 146

Hi,
Caused by: java.lang.NoClassDefFoundError: javax/xml/stream/XMLStreamException


From error looks like your application is unable to find the class javax.xml.stream.XMLStreamException

This may be due to the jar is not in a classpath of your application.

Thanks


The important thing is not to stop questioning.Curiosity has its own reason for existing.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19538
    
  16

Which is probably caused by using an older Java version. Since Java 6 that class is part of the core API.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
 
subject: Exception in thread "main" org.apache.poi.POIXMLException: java.lang.reflect.InvocationTargetExcepti
 
Similar Threads
WPS 6.0 Server startup error
Auto Filter using POI
ClassNotFoundException: TypeSystemHolder
Make sure the generated binary files are on the classpath
classpath problem