23 Jul

New FAQ: CmisRuntimeException with an Internal Server Error running A.A.A.R. with Solr Indexing

During the past months few users emailed me to ask for a support becausealfresco-pentaho they received an ‘Internal Server Error’ while running the A.A.A.R. v1.3. I would like to thank them for the energy they put to solve the problem and specially Gabriele Barbara that wrote the post I share below. The current post has been added to the A.A.A.R.’s FAQ hoping will help someone else.

Gabriele Barbara say:

Using the latest version of A.A.A.R. (v1.3) on Alfresco Community 4.2.c, Windows platform and MySQL database, you could get an error message.

ERROR 19-05 13:33:54,593 - Cmis Input documents before last update - Unxpected Error
ERROR 19-05 13:33:54,593 - Cmis Input documents before last update – org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException: Internal Server Error

After running:

kitchen.bat /rep:"AAAR_Kettle" /job:"Get all" /dir:/Alfresco /user:admin /pass:admin /param:get_parents=true /level:Basic

The problem appears when the job goes to step “get nodes” (if in fact you are running

kitchen.bat /rep:"AAAR_Kettle" /job:"Get audit" /dir:/Alfresco /user:admin /pass:admin /level:Basic

 the job ends properly) and seems to be linked to the “SOLR SSL certificate”.

If in the file ‘<Alfresco>/tomcat/shared/classes/alfresco-global.properties’ there is the line:

index.subsystem.name=solr

You can solve the problem by following these steps:

  • Shutdown Tomcat
  • Comment out the line below and replace with:
index.subsystem.name=lucene
index.recovery.mode=FULL
  • Save the file
  • Start Tomcat
  • Modify again  the file ‘<Alfresco>/tomcat/shared/classes/alfresco-global.properties’ changing as described 
index.recovery.mode=AUTO
  • Save the changes and close the file

Now if you try again to run from the command line: 

kitchen.bat /rep:"AAAR_Kettle" /job:"Get all" /dir:/Alfresco /user:admin /pass:admin /param:get_parents=true /level:Basic

the execution of the job should be finished properly.

11 Mar

Step by step installation of Alfresco Community 4.2.c on Windows Server 2008 R2 Standard 64bit… please, no bundle!

Alfresco Community 4.2.cAfter the high interest of the installation tutorial under Ubuntu plaform, in this post is shared the installation of Alfresco Community 4.2.c on Windows Server 2008 R2 Standard 64bit with Apache Tomcat 7.0.30 and PostgreSQL 9.0.10. The purpose installation is not the bundle installation but a more “robust” for an enterprise configuration. As we like and prefer the installation is a step by step list of commands and tasks… simpler to understand, to do and to test. Hope you’ll be agree.

Before starting…

In this tutorial I use a brand new Windows Server 2008 R2 Standard 64bit installation with a user called ‘alfresco’, different from the Administrator user. Connected as ‘alfresco’ user:

JDK 1.7u7

http://www.oracle.com/technetwork/java/javase/downloads/index.html

  • Download and execute ‘jdk-7u7-windows-x64.exe’.
  • Install the jdk in ‘C:AlfrescoJavajdk1.7.0_07’.
  • Install the jre in ‘C:AlfrescoJavajre7’.
  • Click on Start -> Digit ‘cmd’ and press enter.
java -version
  • Check the java version described.
  • Right click on ‘Computer’ -> Properties -> Advanced settings -> Environment variables -> New variable with name ‘JAVA_HOME’ and value ‘C:AlfrescoJavajdk1.7.0_07’ -> Press ‘Ok’ and close all.

ImageMagick 6.7.9-4

To enable image manipulation in Alfresco, we have to install and configure ImageMagick.
Official site: http://www.imagemagick.org/script/binary-releases.php#windows
Binaries: http://imagemagick.spd.co.il/binaries/

  • First of all download GhostScript 9.06 (gs906w64.exe) used to render PDF documents, from Google Code.
  • Install gs906w64.exe in ‘C:Alfrescogs9.06’.
  • Download ‘ImageMagick-6.7.9-4-Q16-windows-x64-static.exe’ from here.

ATTENTION: Other ImageMagik versions could not work.

  • Install ‘ImageMagick-6.7.9-4-Q16-windows-x64-static.exe’ in ‘C:AlfrescoImageMagick’.
  • During the installation, check flags: ‘Add application directory to your system path’ and ‘Associate supported file extensions with ImageMagick’.
  • Click on Start -> Digit ‘cmd’.
convert.exe -version
  • Check the version described.
ffmpeg
  • Check the version described.

SWFTools 0.9.1

SWFTools is a collection of utilities to work with Adobe Flash files (SWF files).
Download it from ‘http://www.swftools.org/download.html‘.

  • Download ‘swftools-0.9.1.exe’ in the Windows section.
  • Install in ‘C:AlfrescoSWFTools’ for all users.
  • Do not create shortcut or other.
  • Right click on ‘Computer’ -> Properties -> Advanced settings -> Environment variables -> Select ‘Path’ -> Modify -> Add ‘;C:AlfrescoSWFTools’ at the end -> Press ‘Ok’ and close.
  • Click on Start -> Digit ‘cmd’
pdf2swf.exe -V
  • Check the version described.

LibreOffice Windows, version 3.5.7, English (GB)

LibreOffice is used to manage office documents.
Download site: http://www.libreoffice.org/download
Previous versions: http://www.libreoffice.org/download/?nodetect

  • Download and execute ‘LibO_3.5.7_Win_x86_install_multi.msi’.
  • Install for all the users.
  • Custom installation.
  • Install in ‘C:AlfrescoLibreOffice’.
  • Leave defaults (desktop link apart).
  • Click on Start -> Digit ‘cmd’.
C:AlfrescoLibreOfficeprogramsoffice.exe
  • LibreOffice will start.

Let’s discuss about tuning. Alfresco requires that Office runs headless as a hidden process. To do that:

  • Click on Start -> Digit ‘cmd’.
C:AlfrescoLibreOfficeprogramsoffice.exe "-accept=socket,host=localhost,port=8101;urp;StarOffice.ServiceManager" -nologo -headless
  • To check the Office processes: open the task manager where there are two different processes called “soffice.exe *32” and “soffice.bin *32”.
  • Select “soffice.exe *32” and terminate the process. Also the other will be terminated.
  • Click on Start -> Digit ‘notepad++.exe C:AlfrescoLibreOfficestart_oo.bat’ and create a new file.
@echo off

rem -----------------------------
rem -                           -
rem - START Resident OpenOffice -
rem -                           -
rem -----------------------------

C:AlfrescoLibreOfficeprogramsoffice "-accept=socket,host=localhost,port=8101;urp;StarOffice.ServiceManager" -nologo -headless
  • Save and exit.
  • Click on Start -> Digit ‘C:AlfrescoLibreOfficestart_oo.bat’.

ATTENTION: A command window will be opened with no content and never closed. Don’t worry, close it and everything will be fine.

  • Open the task manager and check again the two processes: “soffice.exe *32” and “soffice.bin *32”.

ATTENTION: Restarting the system, the Office headless processes will not restart. Remeber to execute the ‘start_oo.bat’ script otherwise no preview or Office documents will be managed by Alfresco.

PostgreSQL 9.0.10

Download from  ‘http://www.enterprisedb.com/products-services-training/pgdownload#windows‘.

  • Execute the installation.
  • Install in ‘C:AlfrescoPostgreSQL9.0’.
  • Set data folder as ‘C:AlfrescoPostgreSQL9.0data’.
  • Choose your own password.
  • Press next, next, next…
  • No added packages with StackBuilder.

Now it’s time to customize the PostgreSQL installation for Alfresco.

  • Click on Start -> PostgreSQL 9.0 -> SQL shell (psql)
  • Login as default user
CREATE ROLE alfresco WITH PASSWORD 'alfresco' LOGIN;
CREATE DATABASE alfresco WITH OWNER alfresco;
  • q to exit
  • Click on Start -> PostgreSQL 9.0 -> SQL shell (psql)
  • Login as ‘alfresco’ user on the ‘alfresco’ db with password ‘alfresco’.
ALTER USER alfresco WITH PASSWORD 'alfresco';
  • q to exit

Tomcat 7.0.30

Download from ‘http://tomcat.apache.org/‘.

  • Download ‘Tomcat 7.0’ -> Quick Navigation -> Archives -> 7.0.30 -> bin -> apache-tomcat-7.0.30-windows-x86.zip
  • Unzip it in ‘C:Alfresco’ and rename ‘apache-tomcat-7.0.32’ in ‘tomcat’.
  • Click on Start -> Digit ‘cmd’
cd C:Alfrescotomcatbin
startup.bat
  • A command window will be opened with inside all the execution logs of the Tomcat start.
  • At the end, after few seconds, open a browser to the url: http://localhost:8080/
  • To stop the Tomcat server, in the command window, execute:
shutdown.bat

Let’s customize the Tomcat installation for Alfresco.

  • Click on Start -> Digit ‘C:Alfrescotomcatconf’.
  • Copy ‘catalina.properties’ in ‘catalina.properties.orig’.
  • Click on Start -> Digit ‘notepad++.exe C:Alfrescotomcatconfcatalina.properties’
  • Replace the ‘shared.loader’ line, initially set empty, to this value
shared.loader=${catalina.base}/shared/classes,${catalina.base}/shared/lib/*.jar
  • Save and exit.
  • Copy ‘server.xml’ in ‘server.xml.orig’.
  • Click on Start -> Digit ‘notepad++.exe C:Alfrescotomcatconfserver.xml’
  • Add ‘URIEncoding=”UTF-8″‘ to:
<Connector port="8080" protocol="HTTP/1.1"...
  • Save and exit.
  • Click on Start -> Digit ‘C:Alfrescotomcatconf’.
  • Copy ‘context.xml’ in ‘context.xml.orig’.
  • Click on Start -> Digit ‘notepad++.exe C:Alfrescotomcatconfcontext.xml’
  • Add this line between the ‘<Context>’ starting and closing tag.
<Valve className="org.apache.catalina.authenticator.SSLAuthenticator" securePagesWithPragma="false" />
  • Save and exit.
  • From the Alfresco package ‘alfresco-community-4.2.c.zip’ extract the ‘postgresql-9.0-802.jdbc4’ from the ‘web-serverlib’ folder and copy it in ‘C:Alfrescotomcatlib’.

Alfresco Community 4.2.c

  • Click on Start -> Digit ‘C:Alfrescotomcat’
  • Create folder ‘endorsed’.
  • Create folder ‘shared’.
  • Create folder ‘shared/classes’.
  • Create folder ‘shared/lib’.
  • Unzip the ‘alfresco-community-4.2.c.zip’ package in ‘C:Alfrescotomcat’.
  • Move all the content of the folder ‘web-server/endorsed’ in ‘endorsed’.
  • Move all the content of the folder ‘web-server/shared’ in ‘shared’.
  • Move all the content of the folder ‘web-server/webapps’ in ‘webapps’.
  • Delete the file ‘README.txt’.
  • Delete the folder ‘web-server’.
  • Right click on ‘Computer’ -> Properties -> Advanced settings -> Environment variables -> Select ‘Path’ -> Modify -> Add ‘C:Alfrescotomcatbin’ -> Press ‘Ok’ and close.
  • Click on Start -> Digit ‘C:Alfrescotomcatsharedclasses’
  • Copy ‘alfresco-global.properties.sample’ in ‘alfresco-global.properties’
  • Click on Start -> Digit ‘notepad++.exe C:Alfrescotomcatsharedclassesalfresco-global.properties’.
  • Change the settings as described below, leaving all the rest not modified.
...
dir.root=C:\Alfresco\alf_data
# IMPORTANT: Leave the comment on the dir.keystore property.
...
db.username=alfresco
db.password=alfresco
...
#
# External locations
#-------------
# LibreOffice installation
ooo.exe=C:\Alfresco\LibreOffice\program\soffice.exe
ooo.enabled=true
jodconverter.officeHome=C:\Alfresco\LibreOffice
jodconverter.portNumbers=8101
jodconverter.enabled=true
# ImageMagick installation
img.root=C:\Alfresco\ImageMagick
img.exe=C:\Alfresco\ImageMagick\convert.exe
# SWFTools exe
swf.exe=C:\Alfresco\SWFTools\pdf2swf.exe
...
db.schema.update=true
...
db.driver=org.postgresql.Driver
db.url=jdbc:postgresql://localhost:5432/alfresco
...
index.recovery.mode=AUTO
...
authentication.chain=alfrescoNtlm1:alfrescoNtlm
...
alfresco.rmi.services.host=0.0.0.0
...
  • Save and exit.

Now it’s time to define the start/stop script.

  • Click on Start -> Digiti ‘notepad++.exe C:Alfrescoalfresco.bat’
  • Of course create it with this content.
@echo off

rem ---------------------------
rem -                         -
rem - Start and Stop Alfresco -
rem -                         -
rem ---------------------------

set ALF_HOME=C:Alfresco
set CATALINA_HOME=%ALF_HOME%tomcat
set JAVA_OPTS=%JAVA_OPTS% -Xms512m -Xmx768m -Xss768m -server -XX:MaxPermSize=256M

if /I "%1"=="start" goto :start
if /I "%1"=="stop" goto :stop
echo Usage: alfresco.bat [start stop]
goto :end

:start
%CATALINA_HOME%binstartup.bat
goto :end

:stop
%CATALINA_HOME%binshutdown.bat
goto :end

:end
  • Save and exit.
  • Click on Start -> Digit ‘cmd’ -> Right click on ‘cmd’ and execute it as administrator.
cd C:Alfresco
alfresco.bat start
  • A command window will be opened with inside all the execution logs of the Alfresco start.
  • Some minutes should be enough…
  • During bootstrap no error should appear.
  • At the end, open a browser and access to the url ‘http://localhost:8080/share’.

Last but not least, remember to copy ‘C:AlfrescotomcatbinWin32NetBIOSx64.dll’ in ‘C:WindowsSystem32’. This is usefull to make work the CIFS access to Alfresco on this Windows platform.

That’s all…