The problem is the same as described here
But since no solution found there, trying to reopen the topic here? In short, I'm using Apache POI 3.8. I have a *.xlsm file with Macros in it. I am trying to open this file while the application is deployed, but getting the error inside "XSSFWorkbook" constructor which says that "ZIP entry size is too large". The strange part is that I am able to perform that operation locally in my IDEA without any problems. Would appreciate if someone would share the ideas of what is happening, if any had such issue in the past.
Glancing a bit through the related code, my guess is that it depends on where the file is located. Possibly if it is a File then poi is handling it differently than if it is some other source (e.g. in memory)?
If that is the case, then you could probably solve the problem by writing the file to a temporary file and then loading it into poi. Specifically, if you create an XSSFWorkbook from a File, you should not hit this issue. According to the javadoc, you do this:
OPCPackage pkg = OPCPackage.open(path);
XSSFWorkbook wb = new XSSFWorkbook(pkg);
// work with the wb object
......
pkg.close(); // gracefully closes the underlying zip file
So the reason was that Maven was corrupting template file when building application archive.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With