问题
While executing below code,
FileInputStream fis = new FileInputStream("C:\\Users\\deepa\\Downloads\\TestDocument.xlsx");
XSSFWorkbook workbook = new XSSFWorkbook(fis);
I am getting error as
InputStream of class class org.apache.commons.compress.archivers.zip.ZipArchiveInputStream is not implementing InputStreamStatistics.
I have included all the apace poi jar files and common -compress jar file. Please help.
回答1:
Not a java expert of any sorts, but I use Selenium for test automation and was also getting this error. Somehow I found a solution:
- Open the .classpath file with a file editor.
- Cut your classpathentry that contains commons-compress-1.18.jar and paste it at the beginning below classpathentry
kind="con"path="org.testng.TESTNG_CONTAINER"
- Save and retry your program.
It solved my problem. Sorry I can't explain why (I am not a real programmer).
来源:https://stackoverflow.com/questions/52577367/getting-error-with-apache-poi-which-is-not-able-to-read-file-passed-using-filein