javaexcelmavenapache-poijxls

POI - ZIP entry size is too large


I use JXLS to create my woorkbook. JXLS uses POI underneath. To create a workbook JXLS either need a File or an input stream.

With file object I get my desired woorkbook. But, with stream I get error ZIP entry size is too large.

JXLS lib use

WorkbookFactory.create()

method to create workbook. So, I tried with ZipStream and PushbackStream; no help. I was able to run the same code from my Junit.

I read the below post. Why am I getting exception "IOException: ZIP entry size is too large" when trying to open an Excel file using Apache POI?.

The solution form the post is, a change in Maven. But, the post did not mentioned about the change made in Maven.

Do you have any suggestions?


Solution

  • I found the issue. The issue is Maven is ignoring the files I kept inside my resources. So i added resource filtering like below to include my excel templates.

    <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
                <excludes>
                    <exclude>**/*.xlsx</exclude>
                </excludes>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>false</filtering>
                <includes>
                    <include>**/*.xlsx</include>
                </includes>
            </resource>
    </resources>