Report export to PDF error with LibreOffice

Hi,
In our production environment cannot export report to PDF with Libreoffice . We have no problems in development environment with Ubuntu 24.04 Desktop and Libreoffice 7.4. Our production server is a GUI-less Ubuntu Server 24.04 with OpenJDK 17, Apache Tomcat 10, and Libreoffice 7.4 all installed via apt.
Our application is JMIX 2.5.1 In our production server we’ve followed the instructions in the Jmix Reports add-on documentation for setting up Libreoffice on Ubuntu Server, but when we run any report, we get the error:
"ReportingException: Unable to convert to writer_pdf_Export. All attempts failed Report name [M304-02 Full de salari]
Unable to create Open office components.
io.jmix.reports.yarg.formatters.impl.doc.connector.BootstrapException: Unable to connect to the OO process
Unable to connect to the OO process
java.net.ConnectException: Connection refused"

Best regards,
Francesc,

Hi,

Did you try different JDK as mentioned in Jmix application libreoffice error? Can you if you didn’t?

Is LibreOffice server actually running?
Check it with ps aux | grep soffice.
Also check port which LibreOffice is listening - it should match the port set in property jmix.reports.office-ports.

Regards,
Ivan

Hi Ivan,
Did you try different JDK as mentioned in Jmix application libreoffice error? Can you if you didn’t?

Yes, we’ve tested our application with OpenJDK 21. Same result.

Is LibreOffice server actually running?
Check it with ps aux | grep soffice .
Also check port which LibreOffice is listening - it should match the port set in property jmix.reports.office-ports.

ps aux | grep soffice
root 9294 38.9 0.6 434104 98976 pts/1 Sl 08:47 0:01 /usr/lib/libreoffice/program/soffice.bin --headless --accept=socket,host=127.0.0.1,port=8100;urp; --nofirststartwizard

jmix.reports.office-ports.=8100,8101,8102,8103

Same result : io.jmix.reports.exception.ReportingException: Unable to convert to writer_pdf_Export. All attempts failed Report name [M304-02 Full de salari]
Unable to create Open office components.
io.jmix.reports.yarg.formatters.impl.doc.connector.BootstrapException: Unable to connect to the OO process
Unable to connect to the OO process
java.net.ConnectException: Connection refused.

Regards,
Francesc

Hi,

Created issue - Unable to connect to LibreOffice on report run on Ubuntu · Issue #4430 · jmix-framework/jmix · GitHub - for further investigation.

Regards,
Ivan

Hi Francesc !

Could you please clarify what difference you have in deploy process for development environment and production environment ?
You mentioned that on production environment you have Apache Tomcat 10, so it means that you just prepare war file and put it in Tomcat ?
Did you check that Tomcat has no connectivity issues for LibreOffice’s ports ?

Regards,
Igor

Hi Igor,

Could you please clarify what difference you have in deploy process for development environment and production environment ?

In production environment we build the war with ./gradlew -Pvaadin.productionMode=true ;app:bootWar and then upload it to tomcat in server.

You mentioned that on production environment you have Apache Tomcat 10, so it means that you just prepare war file and put it in Tomcat ?

Yes,

Did you check that Tomcat has no connectivity issues for LibreOffice’s ports ?

Yes, we’ve checked it and have no issues.

The only difference with Jmix Documentation is that in documentation you propose test LibreOffice with :
strace -e trace=signal /usr/lib/libreoffice/programs/office.bin --headless --accept=“socket,host=localhost,port=8100;urp” --nologo --nolockcheck

but in ubuntu 22 and debian 12 server to start libreoffice the command is /usr/lib/libreoffice/program/soffice.bin

Best regards

Hi Francesc !

We can reproduce problem on our local environment. Problem is under investigation.
Thank you for your full answer.

Regards,
Igor