All my POI built Excel files are suddenly corrupt?

Andreas Reichel <[email protected]> Thu, 10 Oct 2024 11:53:26 +0700
Newsgroups gmane.comp.jakarta.poi.user
Organization manticore-projects Co. Ltd.
Message-ID <d3e7e81de25ce6be97ce94d49736d4cdde5e6913.camel@manticore-projects.com>
--=-pvlCcIpskiFec1JepJ6l
Content-Type: multipart/alternative; boundary="=-v6AMSvcjCVcoSx0JzE55"

--=-v6AMSvcjCVcoSx0JzE55
Content-Type: text/plain; charset="ISO-8859-15"
Content-Transfer-Encoding: quoted-printable

Greetings team and compliments of the day.

Since a few month, all our POI-built Excel files are corrupted when
opening in LibreOffice and/or Excel:


Although the file can be repaired and opened without any noticeable
damage.
The weird thing is: Our Excel export code as not changed at all since,
and all the Excel files fail even from various, different and
independent code paths. Also tested on different machines.

I have also checked, how we write and close those files -- it looks all
innocent and normal to me:

SXSSFWorkbook wb  =3D new SXSSFWorkbook(new XSSFWorkbook(), 100, true, tru=
e);
File outputFile =3D File.createTempFile("test", ".xlsx");

FileOutputStream fileOutputStream =3D new FileOutputStream(outputFile);
wb.write(fileOutputStream);
wb.close();

So I don't even know where/what to look for?

Can you give me some advise how to trace this problem. I have attached
such an Excel, just in case.
The used libraries and dependencies are shown below.

Any hint would be much appreciated!
Thank you, all the best and cheers

Andreas

*
* com.github.pjfanning:excel-streaming-reader:5.0.2
* commons-codec:commons-codec:1.17.1
* commons-io:commons-io:2.17.0
* commons-logging:commons-logging:1.3.2
* org.apache.commons:commons-collections4:4.5.0-M2
* org.apache.commons:commons-compress:1.27.1 (*)
* org.apache.commons:commons-configuration2:2.11.0
* org.apache.commons:commons-lang3:3.17.0
* org.apache.commons:commons-math3:3.6.1
* org.apache.commons:commons-text:1.12.0 (*)
* org.apache.poi:poi-ooxml:5.3.0
* org.apache.poi:poi:5.3.0
*


--=-v6AMSvcjCVcoSx0JzE55
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

<html><head><style>pre,code,address {
  margin: 0px;
}
h1,h2,h3,h4,h5,h6 {
  margin-top: 0.2em;
  margin-bottom: 0.2em;
}
ol,ul {
  margin-top: 0em;
  margin-bottom: 0em;
}
blockquote {
  margin-top: 0em;
  margin-bottom: 0em;
}
</style></head><body><div>Greetings team and compliments of the day.</div><=
div><br></div><div>Since a few month, all our POI-built Excel files are cor=
rupted when opening in LibreOffice and/or Excel:</div><div><br></div><div><=
img src=3D"cid:b524ece5a3802125dfed0f8b4f3ec60d6323019c.camel@manticore-pro=
jects.com-0" width=3D"608px" height=3D"346px"></div><div><br></div><div>Alt=
hough the file can be repaired and opened without any noticeable damage.</d=
iv><div>The weird thing is: Our Excel export code as not changed at all sin=
ce, and all the Excel files fail even from various, different and independe=
nt code paths. Also tested on different machines.</div><div><br></div><div>=
I have also checked, how we write and close those files -- it looks all inn=
ocent and normal to me:</div><div><br></div><div style=3D"background-color:=
#ffffff;color:#000000"><pre style=3D"font-family:'Source Code Pro Medium',m=
onospace;font-size:9.8pt;"><span style=3D"font-size: 9.8pt;">SXSSFWorkbook =
</span><span style=3D"font-size: 9.8pt; color: rgb(135, 16, 148);">wb</span=
><span style=3D"color:#871094;">  </span>=3D new SXSSFWorkbook<span style=
=3D"color:#3f9101;">(</span>new XSSFWorkbook<span style=3D"color:#0e4a8e;">=
()</span>, <span style=3D"color:#1750eb;">100</span>, true, true<span style=
=3D"color:#3f9101;">)</span>;</pre><div style=3D"background-color:#ffffff;c=
olor:#000000"><pre style=3D"font-family:'Source Code Pro Medium',monospace;=
font-size:9.8pt;">File outputFile =3D File.<span style=3D"font-style:italic=
;">createTempFile</span><span style=3D"color:#3f9101;">(</span>"test", ".xl=
sx"<span style=3D"color:#3f9101;">)</span>;<br><br>FileOutputStream fileOut=
putStream =3D new FileOutputStream<span style=3D"color:#3f9101;">(</span>ou=
tputFile<span style=3D"color:#3f9101;">)</span>;<br><span style=3D"color:#8=
71094;">wb</span>.write<span style=3D"color:#3f9101;">(</span>fileOutputStr=
eam<span style=3D"color:#3f9101;">)</span>;<br><span style=3D"color:#871094=
;">wb</span>.close<span style=3D"color:#3f9101;">()</span>;</pre></div></di=
v><div><br></div><div>So I don't even know where/what to look for?</div><di=
v><br></div><div>Can you give me some advise how to trace this problem. I h=
ave attached such an Excel, just in case.</div><div>The used libraries and =
dependencies are shown below.</div><div><br></div><div>Any hint would be mu=
ch appreciated!</div><div>Thank you, all the best and cheers</div><div><br>=
</div><div>Andreas</div><div><br></div><div><ul><li><br></li><li><b>com.git=
hub.pjfanning:excel-streaming-reader:5.0.2</b></li><li><b>commons-codec:com=
mons-codec:1.17.1
  </b></li><li><b>commons-io:commons-io:2.17.0
  </b></li><li>commons-logging:commons-logging:1.3.2</li><li>org.apache.com=
mons:commons-collections4:4.5.0-M2
  </li><li><b>org.apache.commons:commons-compress:1.27.1 (*)
  </b></li><li>org.apache.commons:commons-configuration2:2.11.0
  </li><li><b>org.apache.commons:commons-lang3:3.17.0
  </b></li><li>org.apache.commons:commons-math3:3.6.1
  </li><li>org.apache.commons:commons-text:1.12.0 (*)</li><li><b>org.apache=
.poi:poi-ooxml:5.3.0
  </b></li><li><b>org.apache.poi:poi:5.3.0
  </b></li><li><br></li></ul></div><div><br></div><div><span></span></div><=
/body></html>

--=-v6AMSvcjCVcoSx0JzE55--

--=-pvlCcIpskiFec1JepJ6l--