Report error - Unable to create Open office components

Recently I got the error below when running a report with xls to pdf conversion using LibreOffice. It was working with no problems previously and i don’t think I’ve change anything since. Appreciate any help as I could not figure what is causing the error.

22:42:30.125 WARN  c.h.y.f.impl.xls.PdfConverterImpl - An error occurred while converting xls to pdf. System will retry to generate report again.
com.haulmont.yarg.exception.OpenOfficeException: Unable to create Open office components.
	at com.haulmont.yarg.formatters.impl.doc.connector.OfficeConnection.open(OfficeConnection.java:78) ~[yarg-1.0.67.jar:na]
	at com.haulmont.reports.libintegration.CubaOfficeIntegration$1.call(CubaOfficeIntegration.java:37) ~[reports-core-6.3.6.jar:6.3.6]
	at com.haulmont.reports.libintegration.CubaOfficeIntegration$1.call(CubaOfficeIntegration.java:33) ~[reports-core-6.3.6.jar:6.3.6]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_152]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_152]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_152]
	at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_152]
Caused by: com.sun.star.comp.helper.BootstrapException: null
	at com.haulmont.yarg.formatters.impl.doc.connector.BootstrapConnector.connect(BootstrapConnector.java:131) ~[yarg-1.0.67.jar:na]
	at com.haulmont.yarg.formatters.impl.doc.connector.BootstrapSocketConnector.connect(BootstrapSocketConnector.java:48) ~[yarg-1.0.67.jar:na]
	at com.haulmont.yarg.formatters.impl.doc.connector.OfficeConnection.open(OfficeConnection.java:60) ~[yarg-1.0.67.jar:na]

I am stucked with the error and unable to print any report to pdf format at all. This is on my development machine running macOS Sierra. Can anyone help with this problem I’m facing.

Much appreciate for your help.

Hi,
It seems that LibreOffice process doesn’t start. Check reporting.openoffice.path property in the core application properties. It must refer to a valid LibreOffice directory.

Please attach all logs to the topic from tomcat/log directory for the time you ran the report.

Hi Andrey,

Thanks for your reply.

I’ve checked the path to LibreOffice that is already set.

reporting.openoffice.path = /Applications/LibreOffice.app

I’ve attached below the full log:

23:29:54.631 INFO  c.h.r.libintegration.CubaReporting - Started report [Consultant Commission Statement] with parameters
consultant:com.genexus.gams.entity.Consultant-6090778e-b665-8e24-33c3-b770c47b68ff [detached]
paymentDate:Tue Jan 15 00:00:00 MYT 2019]
23:30:06.021 WARN  org.docx4j.utils.ResourceUtils - Couldn't get resource: docx4j.properties
23:30:06.022 WARN  org.docx4j.Docx4jProperties - Couldn't find/read docx4j.properties; docx4j.properties not found via classloader.
23:30:06.127 WARN  org.xlsx4j.jaxb.Context - org/docx4j/wml/jaxb.properties not found via classloader.
23:30:06.128 WARN  org.xlsx4j.jaxb.Context - org/docx4j/wml/jaxb.properties not found via classloader.
23:30:10.975 WARN  c.h.y.f.impl.xls.PdfConverterImpl - An error occurred while converting xls to pdf. System will retry to generate report again.
com.haulmont.yarg.exception.OpenOfficeException: Unable to create Open office components.
	at com.haulmont.yarg.formatters.impl.doc.connector.OfficeConnection.open(OfficeConnection.java:78) ~[yarg-1.0.67.jar:na]
	at com.haulmont.reports.libintegration.CubaOfficeIntegration$1.call(CubaOfficeIntegration.java:37) ~[reports-core-6.3.6.jar:6.3.6]
	at com.haulmont.reports.libintegration.CubaOfficeIntegration$1.call(CubaOfficeIntegration.java:33) ~[reports-core-6.3.6.jar:6.3.6]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_152]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_152]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_152]
	at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_152]
Caused by: com.sun.star.comp.helper.BootstrapException: null
	at com.haulmont.yarg.formatters.impl.doc.connector.BootstrapConnector.connect(BootstrapConnector.java:131) ~[yarg-1.0.67.jar:na]
	at com.haulmont.yarg.formatters.impl.doc.connector.BootstrapSocketConnector.connect(BootstrapSocketConnector.java:48) ~[yarg-1.0.67.jar:na]
	at com.haulmont.yarg.formatters.impl.doc.connector.OfficeConnection.open(OfficeConnection.java:60) ~[yarg-1.0.67.jar:na]
	... 6 common frames omitted
23:30:10.980 INFO  c.h.r.libintegration.CubaReporting - An error occurred while running report [Consultant Commission Statement] with parameters [
consultant:com.genexus.gams.entity.Consultant-6090778e-b665-8e24-33c3-b770c47b68ff [detached]
paymentDate:Tue Jan 15 00:00:00 MYT 2019].
23:30:10.982 INFO  c.h.r.libintegration.CubaReporting - Trace: 
com.haulmont.yarg.exception.OpenOfficeException: Unable to create Open office components.
	at com.haulmont.yarg.formatters.impl.doc.connector.OfficeConnection.open(OfficeConnection.java:78) ~[yarg-1.0.67.jar:na]
	at com.haulmont.reports.libintegration.CubaOfficeIntegration$1.call(CubaOfficeIntegration.java:37) ~[reports-core-6.3.6.jar:6.3.6]
	at com.haulmont.reports.libintegration.CubaOfficeIntegration$1.call(CubaOfficeIntegration.java:33) ~[reports-core-6.3.6.jar:6.3.6]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_152]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_152]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_152]
	at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_152]
Caused by: com.sun.star.comp.helper.BootstrapException: null
	at com.haulmont.yarg.formatters.impl.doc.connector.BootstrapConnector.connect(BootstrapConnector.java:131) ~[yarg-1.0.67.jar:na]
	at com.haulmont.yarg.formatters.impl.doc.connector.BootstrapSocketConnector.connect(BootstrapSocketConnector.java:48) ~[yarg-1.0.67.jar:na]
	at com.haulmont.yarg.formatters.impl.doc.connector.OfficeConnection.open(OfficeConnection.java:60) ~[yarg-1.0.67.jar:na]
	... 6 common frames omitted
23:30:10.988 ERROR c.h.cuba.core.sys.ServiceInterceptor - Exception: 
com.haulmont.reports.exception.FailedToConnectToOpenOfficeException: Unable to create Open office components. Report name [Consultant Commission Statement]
	at com.haulmont.reports.ReportingBean.createReportDocument(ReportingBean.java:267) ~[reports-core-6.3.6.jar:6.3.6]
	at com.haulmont.reports.ReportingBean.createReport(ReportingBean.java:166) ~[reports-core-6.3.6.jar:6.3.6]
	at com.haulmont.reports.ReportServiceBean.createReport(ReportServiceBean.java:37) ~[reports-core-6.3.6.jar:6.3.6]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_152]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_152]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_152]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_152]
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333) ~[spring-aop-4.3.1.RELEASE.jar:4.3.1.RELEASE]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) [spring-aop-4.3.1.RELEASE.jar:4.3.1.RELEASE]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) [spring-aop-4.3.1.RELEASE.jar:4.3.1.RELEASE]
	at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:85) ~[spring-aop-4.3.1.RELEASE.jar:4.3.1.RELEASE]
	at com.haulmont.cuba.core.sys.ServiceInterceptor.aroundInvoke(ServiceInterceptor.java:84) ~[cuba-core-6.3.6.jar:6.3.6]
	at sun.reflect.GeneratedMethodAccessor126.invoke(Unknown Source) ~[na:na]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_152]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_152]
	at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:629) [spring-aop-4.3.1.RELEASE.jar:4.3.1.RELEASE]
	at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:618) [spring-aop-4.3.1.RELEASE.jar:4.3.1.RELEASE]
	at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70) [spring-aop-4.3.1.RELEASE.jar:4.3.1.RELEASE]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:168) [spring-aop-4.3.1.RELEASE.jar:4.3.1.RELEASE]
	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) [spring-aop-4.3.1.RELEASE.jar:4.3.1.RELEASE]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) [spring-aop-4.3.1.RELEASE.jar:4.3.1.RELEASE]
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213) [spring-aop-4.3.1.RELEASE.jar:4.3.1.RELEASE]
	at com.sun.proxy.$Proxy211.createReport(Unknown Source) [na:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_152]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_152]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_152]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_152]
	at com.haulmont.cuba.core.sys.remoting.LocalServiceInvokerImpl.invoke(LocalServiceInvokerImpl.java:95) [cuba-core-6.3.6.jar:6.3.6]
	at com.haulmont.cuba.web.sys.remoting.LocalServiceProxy$LocalServiceInvocationHandler.invoke(LocalServiceProxy.java:146) [cuba-web-6.3.6.jar:6.3.6]
	at com.sun.proxy.$Proxy48.createReport(Unknown Source) [na:na]
	at com.haulmont.reports.gui.ReportGuiManager.getReportResult(ReportGuiManager.java:207) [reports-gui-6.3.6.jar:6.3.6]
	at com.haulmont.reports.gui.ReportGuiManager$1.run(ReportGuiManager.java:259) [reports-gui-6.3.6.jar:6.3.6]
	at com.haulmont.reports.gui.ReportGuiManager$1.run(ReportGuiManager.java:254) [reports-gui-6.3.6.jar:6.3.6]
	at com.haulmont.cuba.gui.backgroundwork.LocalizedTaskWrapper.run(LocalizedTaskWrapper.java:55) [cuba-gui-6.3.6.jar:6.3.6]
	at com.haulmont.cuba.web.gui.executors.impl.WebBackgroundWorker$WebTaskExecutor.call(WebBackgroundWorker.java:220) [cuba-web-6.3.6.jar:6.3.6]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_152]
	at com.haulmont.cuba.web.gui.executors.impl.WebBackgroundWorker$WebTaskExecutor.lambda$startExecution$77(WebBackgroundWorker.java:377) [cuba-web-6.3.6.jar:6.3.6]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_152]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_152]
	at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_152]
23:30:11.044 ERROR c.h.c.gui.executors.BackgroundWorker - Exception occurred in background task
com.haulmont.reports.exception.FailedToConnectToOpenOfficeException: Unable to create Open office components. Report name [Consultant Commission Statement]
	at com.haulmont.reports.ReportingBean.createReportDocument(ReportingBean.java:267) ~[na:na]
	at com.haulmont.reports.ReportingBean.createReport(ReportingBean.java:166) ~[na:na]
	at com.haulmont.reports.ReportServiceBean.createReport(ReportServiceBean.java:37) ~[na:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_152]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_152]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_152]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_152]
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333) ~[spring-aop-4.3.1.RELEASE.jar:4.3.1.RELEASE]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) ~[spring-aop-4.3.1.RELEASE.jar:4.3.1.RELEASE]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) ~[spring-aop-4.3.1.RELEASE.jar:4.3.1.RELEASE]
	at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:85) ~[spring-aop-4.3.1.RELEASE.jar:4.3.1.RELEASE]
	at com.haulmont.cuba.core.sys.ServiceInterceptor.aroundInvoke(ServiceInterceptor.java:84) ~[na:na]
	at sun.reflect.GeneratedMethodAccessor126.invoke(Unknown Source) ~[na:na]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_152]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_152]
	at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:629) ~[spring-aop-4.3.1.RELEASE.jar:4.3.1.RELEASE]
	at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:618) ~[spring-aop-4.3.1.RELEASE.jar:4.3.1.RELEASE]
	at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70) ~[spring-aop-4.3.1.RELEASE.jar:4.3.1.RELEASE]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:168) ~[spring-aop-4.3.1.RELEASE.jar:4.3.1.RELEASE]
	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) ~[spring-aop-4.3.1.RELEASE.jar:4.3.1.RELEASE]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.1.RELEASE.jar:4.3.1.RELEASE]
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213) ~[spring-aop-4.3.1.RELEASE.jar:4.3.1.RELEASE]
	at com.sun.proxy.$Proxy211.createReport(Unknown Source) ~[na:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_152]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_152]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_152]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_152]
	at com.haulmont.cuba.core.sys.remoting.LocalServiceInvokerImpl.invoke(LocalServiceInvokerImpl.java:95) ~[na:na]
	at com.haulmont.cuba.web.sys.remoting.LocalServiceProxy$LocalServiceInvocationHandler.invoke(LocalServiceProxy.java:146) ~[cuba-web-6.3.6.jar:6.3.6]
	at com.sun.proxy.$Proxy48.createReport(Unknown Source) ~[na:na]
	at com.haulmont.reports.gui.ReportGuiManager.getReportResult(ReportGuiManager.java:207) ~[reports-gui-6.3.6.jar:6.3.6]
	at com.haulmont.reports.gui.ReportGuiManager$1.run(ReportGuiManager.java:259) ~[reports-gui-6.3.6.jar:6.3.6]
	at com.haulmont.reports.gui.ReportGuiManager$1.run(ReportGuiManager.java:254) ~[reports-gui-6.3.6.jar:6.3.6]
	at com.haulmont.cuba.gui.backgroundwork.LocalizedTaskWrapper.run(LocalizedTaskWrapper.java:55) ~[cuba-gui-6.3.6.jar:6.3.6]
	at com.haulmont.cuba.web.gui.executors.impl.WebBackgroundWorker$WebTaskExecutor.call(WebBackgroundWorker.java:220) ~[cuba-web-6.3.6.jar:6.3.6]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_152]
	at com.haulmont.cuba.web.gui.executors.impl.WebBackgroundWorker$WebTaskExecutor.lambda$startExecution$77(WebBackgroundWorker.java:377) ~[cuba-web-6.3.6.jar:6.3.6]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_152]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_152]
	at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_152]

David,
Please check that catalina.log or localhost.log contains any error or warn messages at that time.

Hi Andrey,

I did not see any other errors from the catalina.out or localhost.log files.

Attached are the log files:

app.log (39.7 KB)
localhost.2019-03-25.log (1.0 KB)
catalina.log (31.8 KB)

I didn’t find any related errors in the logs.
Does the LibreOffice run correctly on your machine (e.g. opening or creating documents using UI)?

We are going to check PDF conversation on macOS tomorrow.

Hi Andrey,

LibreOffice is running correctly using the UI to open / create documents.

However, I think it has some problem starting in listener mode as the command just run and return with no messages. I try starting in listener mode using the command below:

/Applications/LibreOffice.app/Contents/MacOS/soffice --headless --accept="socket,host=localhost,port=8100,tcpNoDelay=1;urp" —-nologo —-nodefault —-norestore —-nolockcheck —-nofirststartwizard

I’ve checked port 8100 not in use.
I have also tried re-installing LibreOffice but still the same problem.

Do you know anything else to troubleshoot this problem? Thanks.

Hi, David!

We performed checks on MacOS and problem was reproduced with reporting.openoffice.path = /Applications/LibreOffice.app app property value. The right path for reporting.openoffice.path is /Applications/LibreOffice.app/Contents/MacOS if LibreOffice installed with default settings. May be problem will be gone if you try it.

Regards,
Sergey.

Hi Sergey/Andrey,

I’ve changed to the openoffice reporting path you’ve suggested but it didn’t resolve the problem. The same errors appeared in the log as before.

Could you please check value of reporting.openoffice.path property at runtime? You can do it via Administration > JMX Console. Find there app-core.cuba:type=ConfigStorage bean and invoke getAppProperty() or printAppProperties() methods.
What version of LibreOffice do you use?

Regards,
Sergey.

Sorry for the late reply, Sergey.

I’m still having the problem. JMX console show the reporting path is set as required.

I’m using LibreOffice version 6.1.5.2