org.apache.poi.openxml4j.exceptions.InvalidOperationException: Can't open the specified file:

pratik picture pratik · Oct 14, 2013 · Viewed 7.2k times · Source

I am getting this error for Data Driven testing with excel.I have added 3.6 version of POI Jar.Below is the ERROR :

    org.apache.poi.openxml4j.exceptions.InvalidOperationException: Can't open the specified file: 'C:\Users\pjadhav1\AppData\Local\Temp\poifiles\poi-ooxml-747722852.tmp'
at org.apache.poi.openxml4j.opc.ZipPackage.<init>(ZipPackage.java:102)
at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:199)
at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:178)
at org.apache.poi.util.PackageHelper.open(PackageHelper.java:53)
at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:176)
at com.iopendr.xls.read.Xls_Reader.<init>(Xls_Reader.java:32)
at com.iopendr.test.DriverScript.start(DriverScript.java:96)
at com.iopendr.test.DriverScript.main(DriverScript.java:60)
    1560 [main] DEBUG devpinoyLogger  - *********INITIALIZE ALL TESTCASES IN***********Login
    Exception in thread "main" java.lang.NullPointerException
at com.iopendr.xls.read.Xls_Reader.getRowCount(Xls_Reader.java:43)
at com.iopendr.test.DriverScript.start(DriverScript.java:106)
at com.iopendr.test.DriverScript.main(DriverScript.java:60)

Answer

demongolem picture demongolem · Jan 9, 2014

The excel file was corrupted. Once fixed, the problem was resolved.