• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Reading a .xlsx excel file using XSSF

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
dom4j-1.6.1
jsr173_1.0_api
poi3.6-20091214
poi-ooxml-3.6-20091214
poi-ooxml-schemas-3.6-20091214
xmlbeans-2.5.0


I have tried downloading many different jar files and nothing seems to get me away from this error.
Help would be much appreciated.
Thanks!
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).
 
It's never done THAT before. Explain it to me tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic