1

I'm trying to open an Excel file (xls extension)

&Error = &FileExcel.Open(&FileName) 

But I'm getting this error

at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.NoSuchMethodError: 'org.apache.poi.poifs.filesystem.DirectoryNode org.apache.poi.poifs.filesystem.POIFSFileSystem.getRoot()

This is the environment:

GX X EVO 3 U7

Ubuntu 20.04

Tomcat 9.0.31

Java version: openjdk 11.0.17 2022-10-18

Java libraries to handle MS Office: I tryed with two different versions:

poi-3.17.jar, poi-ooxml-3.17.jar, poi-ooxml-schemas-3.17.jar

poi-3.8.jar, poi-ooxml-3.8.jar, poi-ooxml-schemas-3.8.jar

In addition Im using LibreOffice in headless mode, which I start in this way:

sudo /usr/bin/soffice --nologo --headless --nofirststartwizard --accept='socket, host=127.0.0.1,port=8100;urp;StarOffice.Service' &

I followed the instructions described here:

https://www5.genexus.com/xev3/scmain.aspx?S%3B178%3B94%3B1264%3B1%3B1%3BO%3B,37721 https://www5.genexus.com/xev3/scmain.aspx?S%3B178%3B94%3B1264%3B1%3B1%3BO%3B,37721

Thanks in advance for your support.

1 Answers1

0

I found the solution:

The same answer I got for a previous issue posted here, is the same for this one: Im working under Tomcat9 and this version comes in a kind of sandboxed state by systemd, here is the explanation.

In my case the MS-Excel files I was reading was out of Tomcat's reaching, which was solved adding the XLS´s path to the file /lib/systemd/system/tomcat9.service (Ubuntu 20.04).

Regards.