We are using POI 3.8 in in our application. Our project is using dbunit to load data sets from .xls files, and apparently dbunit is incompatible with POI 3.8. I get the following exception,
java.lang.NoSuchMethodError: org.apache.poi.hssf.usermodel.HSSFDateUtil.isCellDateFormatted(Lorg/apache/poi/hssf/usermodel/HSSFCell;)Z
It seems dbunit requires POI 3.2. However I cannot downgrade my POI version. Is there any way to fix this problem. In a post I read about downloading dbunit sources and recompile it against poi 3.8. How can this recompiling be done?
There is some discussion about this at the dbunit-bugtracker at http://sourceforge.net/p/dbunit/bugs/332/, unfortunately no update there yet, so it seems dbunit itself does not support this yet.
I was able to recompile dbunit against a newer Apache POI version with the following steps:
svn co http://dbunit.svn.sourceforge.net/svnroot/dbunit/tags/dbunit-2.4.9
3.9
, the -FINAL
was dropped in newer versionsmvn package
mvn -DskipTests=true package
The resulting binary is located under target/dbunit-2.4.9.jar