Win a copy of Emmy in the Key of Code this week in the General Computing 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 ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Error when creating cell comments using POI

 
Greenhorn
Posts: 10
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The below code works fine for HSSFWorkbook but it gives me an error when using for XSSFWorkbook.

Exception in thread "main" java.lang.NoSuchMethodError: schemasMicrosoftComVml.CTShape.getClientDataList()Ljava/util/List;
at org.apache.poi.xssf.usermodel.XSSFComment.setColumn(XSSFComment.java:127)
at org.apache.poi.xssf.usermodel.XSSFDrawing.createCellComment(XSSFDrawing.java:302)
at org.apache.poi.xssf.usermodel.XSSFDrawing.createCellComment(XSSFDrawing.java:50)

The error is thrown for the line Comment comment = drawing.createCellComment(anchor);



Any help appreciated. Thanks in advance.
 
Sheriff
Posts: 24654
58
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My guess: your classpath contains an outdated version of one of the jar files which POI depends on. It would be the jar file which contains the "schemasMicrosoftComVml.CTShape" class -- but I couldn't tell you which jar that might be.
 
Tushar Ravi
Greenhorn
Posts: 10
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Paul for your valuable feedback. I did try creating a separate project and run the same program with only the jars related for this but still in vain
 
Paul Clapham
Sheriff
Posts: 24654
58
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And to create this project, you did what? Did you just copy the jars from the other project (where you had the problem), or did you go right back to the POI download and extract the jars from it?
 
Would you like to try a free sample? Today we are featuring tiny ads:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!