Document preview problem was fixed by changing libreoffice's ctl.sh to libreoffice_ctl.sh

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
billydekid
Established Member II

Document preview problem was fixed by changing libreoffice's ctl.sh to libreoffice_ctl.sh

Jump to solution
Hi,

I just want to share how to fix the problem of document preview which sometimes not fully functional on loading some of certain files.

I use Alfresco 5.0.a on Ubuntu 14.04.

One of the problem occurred when opening .docx files.
Document preview just showing a thumbnail image instead of full frame of document viewer.

The problem can be solved by changing libreoffice's ctl script in alfresco.sh; from ctl.sh to libreoffice_ctl.sh (since ctl.sh is not exist on libreoffice's script dir).

OLD:
LIBREOFFICE_SCRIPT=$INSTALLDIR/libreoffice/scripts/ctl.sh

NEW
LIBREOFFICE_SCRIPT=$INSTALLDIR/libreoffice/scripts/libreoffice_ctl.sh

Next I restarted Alfresco and problem is solved! Smiley Happy
Document viewer frame is appear instead of document thumbnail image…

Regards,
[bayu]
1 Solution

Accepted Solutions
luceros
Member II

Re: Document preview problem was fixed by changing libreoffice's ctl.sh to libreoffice_ctl.sh

Jump to solution

Hi, I resolve this problem changing the path of libreoffice installation on alfresco-global.properties.

From:

ooo.exe=/opt/alfresco-community/libreoffice/program/soffice.bin

to

ooo.exe=/usr/bin/soffice

then I restart alfresco service et voilà.
You must find soffice file on your sistem (this works on linux).

Bye, bye.

21 Replies
caolem
Member II

Re: Document preview problem was fixed by changing libreoffice's ctl.sh to libreoffice_ctl.sh

Jump to solution
I'm using alfresco 5.0.a with debian, in order to fix the office documents preview I did several steps.

1. check if libreoffice is running
/opt/alfresco-5.0.a/libreoffice/scripts/libreoffice_ctl.sh status

2. edit the file /opt/alfresco-5.0.a/alfresco.sh
modify the line LIBREOFFICE_SCRIPT with the correct script path
LIBREOFFICE_SCRIPT=$INSTALLDIR/libreoffice/scripts/libreoffice_ctl.sh

3. test for missing libraries
/opt/alfresco-5.0.a/libreoffice/program/soffice.bin –nofirststartwizard –nologo –headless –accept=socket,host=localhost,port=8100

4. install missing libraries (I had missing libxinerama1 and libdbus-glib-1-2)
apt-get install libxinerama1
apt-get install libdbus-glib-1-2

5. try to start opeoffice using the script
/opt/alfresco-5.0.a/libreoffice/scripts/libreoffice_ctl.sh start

6. restart alfresco
/etc/init.d/alfresco restart

7. you must see the line
/opt/alfresco-5.0.a/libreoffice/scripts/libreoffice_ctl.sh : libreoffice started at port 8100


Now previews work perfectly ;-)
d_hoang
Member II

Re: Document preview problem was fixed by changing libreoffice's ctl.sh to libreoffice_ctl.sh

Jump to solution
Thank You caolem. It was exactly my problem. Prevviews work fine now.  
mkpelletier
Member II

Re: Document preview problem was fixed by changing libreoffice's ctl.sh to libreoffice_ctl.sh

Jump to solution
Hello all!  Thanks for the info here. It has helped me some.

I followed your instructions, @caolem, and made some progress from the default install, however I now get:


12:28:45,009 ERROR [org.springframework.extensions.webscripts.AbstractRuntime] [http-bio-8443-exec-4] Exception from executeScript - redirecting to status template error: connection failed: socket,host=127.0.0.1,port=8100,tcpNoDelay=1; com.sun.star.lang.IllegalArgumentException
net.sf.jooreports.openoffice.connection.OpenOfficeException: connection failed: socket,host=127.0.0.1,port=8100,tcpNoDelay=1; com.sun.star.lang.IllegalArgumentException
   at net.sf.jooreports.openoffice.connection.AbstractOpenOfficeConnection.connect(AbstractOpenOfficeConnection.java:77)
   at org.alfresco.util.OpenOfficeConnectionTester.testAndConnect(OpenOfficeConnectionTester.java:183)
   at org.alfresco.util.OpenOfficeConnectionTester.checkConnection(OpenOfficeConnectionTester.java:129)
   at org.alfresco.util.OpenOfficeConnectionTester.onBootstrap(OpenOfficeConnectionTester.java:101)
   at org.springframework.extensions.surf.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:56)
   at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:96)
   at org.alfresco.repo.management.subsystems.ChildApplicationContextFactory$ChildApplicationContext.publishEvent(ChildApplicationContextFactory.java:554)
   at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:948)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
   at org.alfresco.repo.management.subsystems.ChildApplicationContextFactory$ApplicationContextState.start(ChildApplicationContextFactory.java:809)
   at org.alfresco.repo.management.subsystems.AbstractPropertyBackedBean.start(AbstractPropertyBackedBean.java:991)
   at org.alfresco.repo.management.subsystems.AbstractPropertyBackedBean.onApplicationEvent(AbstractPropertyBackedBean.java:530)
   at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEventInternal(SafeApplicationEventMulticaster.java:209)
   at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEvent(SafeApplicationEventMulticaster.java:180)
   at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334)
   at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:948)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
   at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410)
   at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
   at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
   at org.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:63)
   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4973)
   at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5467)
   at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
   at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
   at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1073)
   at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857)
   at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
   at java.util.concurrent.FutureTask.run(Unknown Source)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)


This seems to only happen when using MySQL rather than the default postgresql.
loruam
Member II

Re: Document preview problem was fixed by changing libreoffice's ctl.sh to libreoffice_ctl.sh

Jump to solution
Great Billythekid!!! It´s a week that i can't resolv this issue. Your solition work fine! Tks
arannasousa
Active Member

Re: Document preview problem was fixed by changing libreoffice's ctl.sh to libreoffice_ctl.sh

Jump to solution
In alfresco 5.0.c, was having connection problems between the alfresco and libreoffice.

In the file:

<alfresco> /libreoffice/scripts/libreoffice_ctl.sh


before:

Soffice="$SOFFICEWRAPPER –nofirststartwizard –nologo –headless –accept=socket,host=localhost,port=$
SOFFICE_PORT\;urp\;StarOffice.ServiceManager"


After (remove "\"):

Soffice="$SOFFICEWRAPPER –nofirststartwizard –nologo –headless –accept=socket,host=localhost,port=$SOFFICE_PORT;urp;StarOffice.ServiceManager"
pknight
Member II

Re: Document preview problem was fixed by changing libreoffice's ctl.sh to libreoffice_ctl.sh

Jump to solution
Does anyone know how to resolve this problem with Alfresco running on Windows server?

I can preview pdf's without issue but office docs won't display

Thanks
danyfortier
Member II

Re: Document preview problem was fixed by changing libreoffice's ctl.sh to libreoffice_ctl.sh

Jump to solution
PKnight, have you resolve the problem ?

I have exactly the same problem here. I am running with Alfreso 5.0.d
danyfortier
Member II

Re: Document preview problem was fixed by changing libreoffice's ctl.sh to libreoffice_ctl.sh

Jump to solution
ok i got it working by restarting tomcat service for now. But still investigating
voula_11
Member II

Re: Document preview problem was fixed by changing libreoffice's ctl.sh to libreoffice_ctl.sh

Jump to solution
I have the same problem on 5.0.d.

I changed alfresco.sh to point to the correct script, I changed libreoffice_ctl.sh to have the correct paths. Still not working.

When I test for missing libraries as suggested by caolem, I get this:
error while loading shared libraries: libdbus-glib-1.so.2: cannot open shared object file: No such file or directory

So I did a "yum install libdbus-glib-1.so.2" and I got this:
Package dbus-glib-0.86-6.10.amzn1.i686 already installed and latest version


So I guess this means that the package is installed in the wrong directory?
I tried removing it and re-installing it, but it still can't be located.

I really don't know what to do to fix this.

Can anyone help please?