This week's book giveaways are in the AI and JavaScript forums.
We're giving away four copies each of GANs in Action and WebAssembly in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of GANs in ActionE this week in the AI forum
or WebAssembly in Action in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Joe Ess
  • salvin francis
  • fred rosenberger

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

Posts: 12
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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(
at org.apache.poi.POIXMLDocument.load(
at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(
at ReadXLSX.main(
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
at java.lang.reflect.Constructor.newInstance(
at org.apache.poi.xssf.usermodel.XSSFFactory.createDocumentPart(
... 4 more
Caused by: java.lang.NoClassDefFoundError: javax/xml/stream/XMLStreamException
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(
at java.lang.Class.getMethod0(
at java.lang.Class.getMethod(
at org.apache.xmlbeans.XmlBeans.buildMethod(
at org.apache.xmlbeans.XmlBeans.buildNodeMethod(
at org.apache.xmlbeans.XmlBeans.buildNodeToCursorMethod(
at org.apache.xmlbeans.XmlBeans.<clinit>(
at org.openxmlformats.schemas.spreadsheetml.x2006.main.StyleSheetDocument$Factory.parse(Unknown Source)
at org.apache.poi.xssf.model.StylesTable.readFrom(
at org.apache.poi.xssf.model.StylesTable.<init>(
... 9 more

Thanks in Advance


Ranch Hand
Posts: 148
Hibernate Tomcat Server Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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

From error looks like your application is unable to find the class

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

Posts: 21841
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which is probably caused by using an older Java version. Since Java 6 that class is part of the core API.
Bras cause cancer. And tiny ads:
Java file APIs (DOC, XLS, PDF, and many more)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!