cancel
Showing results for 
Search instead for 
Did you mean: 

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

billydekid
Star Contributor
Star Contributor
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 ACCEPTED ANSWER

luceros
Champ in-the-making
Champ in-the-making

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.

View answer in original post

21 REPLIES 21

caolem
Champ in-the-making
Champ in-the-making
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
Champ in-the-making
Champ in-the-making
Thank You caolem. It was exactly my problem. Prevviews work fine now.  

fwegener
Champ on-the-rise
Champ on-the-rise
Hello,

i'm got the problem that libreoffice isent't running, too. The Problem occurs both with Debian 8 and Ubuntu 14.04. Also i tested with 5.0d and 5.1.

In Share i got only thumbnails with doc-files and a option for downloading file and no preview with docx-files.

i try to test based on your instructions with following result:

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

–> libreoffice dont run and can't be started

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

–> i fixed the file but if i restart alfresco, libreoffice can't be started

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

–> libGl.so1 is missing. Unfortunately it isn't possible to install manually


root@ubuntu:/opt/alfresco-community/libreoffice/scripts# apt-get install  libGl.so.1
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package libGl.so.1
E: Couldn't find any package by regex 'libGl.so.1'

furthermore the linux-version has no gui.

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

–>not possible. look at 3

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

–> libreoffice wont start because i am not able to fix 3 & 4

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

Sry for my bad english guys Smiley Wink Hope anyone can help me.

Thanks a lot

Florian

boiss007
Champ on-the-rise
Champ on-the-rise
just fyi, instead of blindly using ,

#apt-get install libGl.so.1
first use a sudo enabled user, not root (best practice), then do :
sudo apt-get update
apt-cache search libgl

and you will find the necessary libraries to install.

mkpelletier
Champ in-the-making
Champ in-the-making
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
Champ in-the-making
Champ in-the-making
Great Billythekid!!! It´s a week that i can't resolv this issue. Your solition work fine! Tks

arannasousa
Champ on-the-rise
Champ on-the-rise
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"

This solve the problem for me. Kudos.

pknight
Champ in-the-making
Champ in-the-making
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