while creating excel document using poi 3.17 library, getting below error tack Trace java.lang.NoSuchFieldError: RAW_XML_FILE_HEADER at org.apache.poi.poifs.filesystem.FileMagic.<clinit>(FileMagic.java:42) at org.apache.poi.openxml4j.opc.internal.ZipHelper.openZipStream(ZipHelper.java:208) at org.apache.poi.openxml4j.opc.ZipPackage.<init>(ZipPackage.java:98) at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:324) at org.apache.poi.util.PackageHelper.open(PackageHelper.java:37) at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:295) I have added all the below libraries to my classpath: ooxml-schemas-1.3.jar poi-3.17.jar poi-ooxml_schemas-3.17.jar commons-codec-1.10.jar commons-logging-1.2.jar commons-collections4-4.1.jar curvesapi-1.04.jar
do you have poi-ooxml-3.17.jar on your classpath?
Yes, poi-ooxml-3.17.jar was added to my classpath
POI 3.17 is 6 years old. It is no longer supported. This sort of problem with NoSuchFieldError is most commonly caused by users having multiple conflicting copies of the same jar(s) on their classpaths.
I have checked multiple times my classpath and I do not see any duplicates, is there any other thing I can check on this? Thanks for you quick responses.
https://poi.apache.org/help/faq.html has some code you can use to track down additional POI jars files you may have forgotten about
This is very likely a problem with the local environment and different versions of some jar/class-files, so we likely cannot "fix" anything here. Please reopen with more information and a standalone reproducing code-sample if you are confident it is an actual problem in Apache POI itself.