This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Other Open Source Projects and the fly likes Reading a .xlsx excel file using XSSF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Reading a .xlsx excel file using XSSF " Watch "Reading a .xlsx excel file using XSSF " New topic

Reading a .xlsx excel file using XSSF

Christian Teixeira

Joined: Jan 15, 2013
Posts: 1
Hello, I am trying to create a class which reads an xlsx excel file and counts the number of columns in the file. It uses POI-XSSF, is part of a web-app which runs using jetty, and compiles fine.

However, when it is run, I receive this error when it tries to create the new XSSFWorkbook.

java.lang.NoSuchMethodError: org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(Ljava/io/InputStream;)V

I have the following JARs on my build path and dependencies for each in my pom.xml file

I have tried downloading many different jar files and nothing seems to get me away from this error.
Help would be much appreciated.
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 41599
Sounds like you're using two different sets of of jar files for compilation and runtime, respectively. My usual advice would be to forget about Maven and make sure you can compile and run the code using a simpler build method (Ant file, or even without any build tool).

Ping & DNS - my free Android networking tools app
It is sorta covered in the JavaRanch Style Guide.
subject: Reading a .xlsx excel file using XSSF