Bug 64874 - Corrupted xlsx file is generated after removing xalan.jar in poi 4.1.2
Summary: Corrupted xlsx file is generated after removing xalan.jar in poi 4.1.2
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 4.1.2-FINAL
Hardware: PC Linux
: P2 blocker (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2020-11-05 08:15 UTC by Rakhi Barayanan
Modified: 2020-12-10 21:41 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Rakhi Barayanan 2020-11-05 08:15:06 UTC
We are using poi for generating Excel file reports in UNIX platform.We are facing an issue while removing xalan.jar  .We couldn’t find any dependency mentioned while checking the apache poi runtime dependency page.We are using apache poi 4.1.2.

Do Apache POI have any dependency with xalan jar?
After removing the xalan .jar ,even if our xlsx is generated with same size ,but while opening we are getting the following error.

"Excel cannot open the file 'XRFWIN_410613396.xlsx' because the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file."

We have extracted and compared the Excel file generated with and without xalan.

For the error scenario the xml generated is (without xalan)

<?xml version = '1.0' encoding = 'UTF-8' standalone = 'yes'?>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
<Relationship ="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument"/>
<Relationship ="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties"/>
<Relationship ="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties"/></Relationships>

Whereas in the success case it is generated as follows,(with xalan)

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
<Relationship Id="rId1" Target="xl/workbook.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument"/>
<Relationship Id="rId2" Target="docProps/core.xml" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties"/>
<Relationship Id="rId3" Target="docProps/app.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties"/></Relationships>

The error scenario does not include “id”, “target” and “Type”.

Could you please help us on this.
Comment 1 Nick Burch 2020-11-05 16:54:27 UTC
It seems like you have a broken xml parser on your system, which is being used when xalan is removed. Generally we rely on the JVM to give us a working xml parser when we ask it for one

Can you check what xml parser library your system is falling back to?
Comment 2 Dominik Stadler 2020-12-10 21:41:38 UTC
No response, so assuming it was resolved and there is nothing more to do here.