Hi,

When I attempt to open an Excel file (.xlsx) file I receive the following
stack trace.

org.apache.poi.openxml4j.exceptions.InvalidFormatException: The part
/_rels/.rels does not have any content type ! Rule: Package require content
types when retrieving a part from a package. [M.1.14]
  at
org.apache.poi.openxml4j.opc.ZipPackage.getPartsImpl(ZipPackage.java:247)
  at org.apache.poi.openxml4j.opc.OPCPackage.getParts(OPCPackage.java:684)
  at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:275)

The following is my code.

String xlsxPath = "/Users/jonathan.hodges/Downloads/daily-player-feed.xlsx";
FileInputStream is = new FileInputStream(xlsxPath)
OPCPackage pkg = OPCPackage.open(is);
XSSFWorkbook wb = new XSSFWorkbook(pkg);

This file opens fine with Excel.  I tried both as File and FileInputStream
and receive the same error.  I tried HSSF as well which returns that the
file appears to be Office 2007+ XML.

Searching the web I found a similar unresolved bug from 2013.

https://mail-archives.apache.org/mod_mbox/poi-dev/201304.mbox/%[email protected]/bugzilla/%3E

Any ideas on how to resolve this?

Thanks!

Jonathan

Reply via email to