Andi, Thank you for the quick reply. The .xlsx file from the test run has the same file structure as the .xlsx from the real run that doesn't open. The JAR I upload to an application server is shaded and includes the POI library that is relocated to its version specific packages to avoid collision. So it's the same version of POI as the test run.
If there is no better way, I could somehow record all POI calls in the real run, and ptu it to the unit test, but I'd rather want to avoid this route as it is very time consuming. I am hoping there's a way for Excel to tell me what errors it is seeing. On Mon, Feb 3, 2020 at 12:03 PM Andreas Beeker <[email protected]> wrote: > Hi, > > I'd do the same in the unit test as in the real run. > Unzip and compare both files. > What's the difference? > > What is a real run like? is this a web application? > Do you have duplicated POI jars in the classpath? > > Andi > > On 03.02.20 20:55, Kuro Kurosaka wrote: > > Hi, > > I created an .xlsx file using Apache POI XML (using XSSFWorkbook class). > > The .xlsx file created by a unit test could be opened from Excel but > when I > > tried to open the .xlsx file from a real run, Excel won't open it with an > > error message like this in its pop up: > > ---- > > Excel cannot open the file 'myfile.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. > > ---- > > > > Is there a way to make Excel printout more detailed error message? > > Are there any other debugging tips? > > > > I unzipped the generated .xlsx file and the one that can be opened, > > and I found these files are missing from the one that won't open. > > Do these need to exist? > > > > xl/theme/theme1.xml > > xl/connections.xml > > xl/queryTable/queryTable1.xml > > > > > -- T. Kuro Kurosaka, Software Engineer, Spartan Software Inc.
