Category: Alfresco

Alfresco 4.3.d PDFBox fatal error Java Runtime

Our JVM kept crashing as soon as we went to the ‘Document Library’ within Alfresco 4.3.d

We tracked the issue down to a uploaded PDF file which contained metadata that the shipped version of PDFBox 1.2.1 (pdfbox-1.2.1.jar) chokes on and takes out the JVM.

By replacing the pdfbox.jar with the latest version pdfbox-1.7.1.jar our issues seem to have gone.

Replace old file with new in :  /alfresco-3.4.d/tomcat/webapps/alfresco/WEB-INF/lib/

Random error we where receiving in ‘catalina.out’ shown below:

# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x59ee264a, pid=4534, tid=1553988496
#
# JRE version: 6.0_18-b07
# Java VM: Java HotSpot(TM) Server VM (16.0-b13 mixed mode linux-x86 )
# Problematic frame:
# C [libfontmanager.so+0x2464a]
#
# An error report file with more information is saved as:
# /opt/alfresco-3.4.d/hs_err_pid4534.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.

Alfresco & Flash upload issue

Having issues uploading to Alfresco Share using its Adobe flash up-loader?

As weird as this sounds, try updating your installation of Internet Explorer.

Even if your not using Internet Explorer, lets be honest who still is! 🙂

This has solved issues that we’ve been having, machines which still had IE6 on them, when updated to IE8 the up-loader would work in both Firefox and Chrome.

It also allowed us to use Primefaces 2.2 fileUpload on the machine it wasn’t working on, after updating IE.

Glassfish JVM crash issues under Alfresco 3.4d

We’re running Alfresco 3.4d on Glassfish 3.1 / Redhat 5.7

We noticed last week that ‘Java SE Development Kit 6 Update 26’ was occasionally crashing the JVM by using all the available memory, when Alfresco was using resources outside of the JVM.

We solved this by installing ‘Java SE Development Kit 6 Update 29’.

Just thought that we would post that out there, just in case your facing similar issues and haven’t a clue what is causing them, when the JVM crashes it doesn’t post its issues into the Glassfish server.log file, as that has crashed milliseconds beforehand.

Alfresco Share Document Previews

Getting Alfresco Share to correctly display document previews can be a royal pain, hopefully the following information will help you get yours to work.

The headless Open Office packages which come with RHEL5 don’t work correctly, if your using the same O/S
remove the existing installed packages & install the whole program on your server from www.openoffice.org
– This was a big part of our issues.
There are no reasons behind this, just a little bit of information here

Next install the required packages :
pdf2swf
convert

Edit:
vi /usr/local/glassfish3.1/glassfish/domains/domain1/lib/classes/alfresco-global.properties

Change so it reads:
#
# External locations
#-------------
ooo.exe=/opt/openoffice.org3/program/soffice.bin
ooo.enabled=true
img.root=/usr/local/bin
img.exe=/usr/local/bin/convert
swf.exe=/usr/local/bin/pdf2swf

Now check to see if these files that you’ve just installed in ‘/usr/local/bin’ are running correctly, we were having issues, see below:
[root@server bin]# /usr/local/bin/pdf2swf
./pdf2swf: error while loading shared libraries: libjpeg.so.7: cannot open shared object file: No such file or directory

This was because the library wasn’t been located, so we deleted/recreated any links to the missing files in both the below locations (just to make sure, as wasnt sure where each program was looking for its required library)

[root@server /]# find ./ -name libjpeg.so.7
./usr/local/lib/libjpeg.so.7
./usr/lib/libjpeg.so.7

‘/usr/lib’
libjpeg.so.7 -> /usr/local/lib/libjpeg.so.7

‘/usr/local/lib’
libjpeg.so.7 -> libjpeg.so.7.0.0

And ‘just like that’ it was working, make sure you also check where ‘convert’ is working.
It took us hours to figure out what was going wrong, so I hope this shines some light on your dark day.

SWFTools installation with freetype problem

pdf2swf is required for Alfresco global setting. We need to install swftools.

error message when try to install swftools:

./configure

. . .

freetype/config/ ftheader.h: No such file or directory

. . .

Freetype has been install at /usr/local/include/, ftheader.h is located in /usr/local/include/freetype2/freetype/config

Solution:

Add a symbolic link

ln -s /usr/local/include/freetype2/freetype     /usr/include/freetype

Alfresco Share custom themes

Want to know how to create your own custom Alfresco Share theme ?

Follow this guide:

Copy an existing themes folder & files, such as /Share/themes/greenTheme to /Share/themes/YOUR_THEME

Copy /share/WEB-INF/classes/alfresco/site-data/themes/default.xml to /share/WEB-INF/classes/alfresco/site-data/themes/YOUR_THEME.xml

Edit YOUR_THEME.xml

Default Blue Theme
theme.default

Change where it mentions ‘Default Blue’ to a title of your choosing, change ‘theme.default‘ to ‘theme.YOUR_THEME‘.

Edit /YOUR_THEME/presentation.css

Change all occurrences of ‘greenTheme‘ :
.yui-skin-greenTheme
for
.yui-skin-YOUR_THEME

Edit /YOUR_THEME/yui/assets/skin.css

Change all occurrences of ‘greenTheme‘ :
.yui-skin-greenTheme
for
.yui-skin-YOUR_THEME

The above 2 steps can be easily done using a find and replace function in any text editor.

Now select your new theme within Share under the Admin Console.

Now edit the .css files and images to your hearts content, refreshing the browser to see your changes.

Lovely!

Glassfish3, Alfresco3.3g, LDAP authentication and properties mapping

Need to know how to get LDAP working with your Alfresco installation?

Confused by all of what you’ve read on forums and wikis?

Then follow this guide :

1. Edit /YOUR_Glassfish/domains/domain1/lib/classes/alfresco-global.properties, let alfresco use LDAP authentication chain:

Before : authentication.chain=alfrescoNtlm1:alfrescoNtlm

After : authentication.chain=alfrescoNtlm1:alfrescoNtlm,ldap1:ldap

2. Create folder /YOUR_Glassfish/domains/domain1/lib/classes/alfresco/extension/subsystems/Authentication/ldap/ldap1

3. Copy file /YOUR_Glassfish/domains/domain1/applications/alfresco/WEB-INF/classes/alfresco/subsystems/Authentication/common-ldap-context.xml to /YOUR_Glassfish/domains/domain1/lib/classes/alfresco/extension/subsystems/Authentication/ldap/common-ldap-context.xml

4. Copy the two files (ldap-authentication.properties, ldap-authentication-context.xml) in /YOUR_Glassfish/domains/domain1/applications/alfresco/WEB-INF/classes/alfresco/subsystems/Authentication/ldap/ to /YOUR_Glassfish/domains/domain1/lib/classes/alfresco/subsystems/Authentication/ldap/ldap1/

5. Edit /YOUR_Glassfish/domains/domain1/lib/classes/alfresco/subsystems/Authentication/ldap/ldap1/ldap-authentication.properties for ldap setting:

ldap-authentication.properties

# This flag enables use of this LDAP subsystem for authentication. It may be
# that this subsytem should only be used for synchronization, in which case
# this flag should be set to false.
ldap.authentication.active=true

# The authentication mechanism to use
ldap.authentication.java.naming.security.authentication=simple

# The default principal to use (only used for LDAP sync)
ldap.synchronization.java.naming.security.principal=YOUR_PRINCIPAL_NAME

# The password for the default principal (only used for LDAP sync)
ldap.synchronization.java.naming.security.credentials=YOUR_PASSWORD

# How to map the user id entered by the user to that passed through to LDAP
# - simple
#    - this must be a DN and would be something like
#      uid=%s,ou=People,dc=company,dc=com
# - digest
#    - usually pass through what is entered
#      %s
# If not set, an LDAP query involving ldap.synchronization.personQuery and

# ldap.synchronization.userIdAttributeName will

# be performed to resolve the DN dynamically.

ldap.authentication.userNameFormat=CN=%s,CN=Users,DC=your company

# The URL to connect to the LDAP server
ldap.authentication.java.naming.provider.url=Your LDAP URL

# This flag enables use of this LDAP subsystem for user and group
# synchronization. It may be that this subsytem should only be used for
# authentication, in which case this flag should be set to false.
ldap.synchronization.active=true

# The query to select all objects that represent the groups to import.
#ldap.synchronization.groupQuery=(objectclass\=groupOfNames)

# The group search base restricts the LDAP group query to a sub section of tree on the LDAP server.
ldap.synchronization.groupSearchBase=Your search base
# If positive, this property indicates that range retrieval should be used to fetch
# multi-valued attributes (such as member) in batches of the specified size.
# Overcomes any size limits imposed by Active Directory.
ldap.synchronization.queryBatchSize=10

# The query to select all objects that represent the users to import.
ldap.synchronization.personQuery=(objectclass\=person)

# The user search base restricts the LDAP user query to a sub section of tree on the LDAP server.
ldap.synchronization.userSearchBase=Your user search base

# The attribute name on people objects found in LDAP to use as the uid in Alfresco, depend on your LDAP server
ldap.synchronization.userIdAttributeName=cn

# The timestamp format. Unfortunately, this varies between directory servers.
ldap.synchronization.timestampFormat=yyyyMMddHHmmss'.0Z'

# The attribute on person objects in LDAP to map to the email property in Alfresco,depend on your LDAP server
ldap.synchronization.userEmailAttributeName=mail

# The attribute on person objects in LDAP to map to the first name property in Alfresco, depend on your LDAP server
ldap.synchronization.userFirstNameAttributeName=givenName

# The attribute on person objects in LDAP to map to the last name property in Alfresco,depend on your LDAP server
ldap.synchronization.userLastNameAttributeName=sn

# The default home folder provider to use for people created via LDAP import,depend on your LDAP server
ldap.synchronization.userOrganizationalIdAttributeName=company

6. Restart glassfish. Alfresco Explorer and Share should now work with your LDAP server.

Alfresco community 4.0 installation on Glassfish 3.1

PLEASE NOTE:

The following worked only on Alfresco 3.4d – We tried to get it to work on version 4.0 but it will not.
We have now resorted to using the Tomcat Bundled version of 3.4d as our server is 32bit linux.

Follow the below instructions if you still want, but be it on your own head 🙂

1. Get alfresco war files for deployment in existing application servers package file  alfresco-community-4.0.a.zip from https://process.alfresco.com/ccdl/?file=release/community/build-3755/alfresco-community-4.0.a.zip

2. MySql setting

mysql>create database alfresco;

mysql>grant all privileges on alfresco.* to ‘YOUR_ALFRESCO_USERNAME’@’%’ identified by ‘YOUR_ALFRESCO_PASSWORD’;

mysql>grant all privileges on alfresco.* to ‘YOUR_ALFRESCO_USERNAME’@’localhost’ identified by ‘YOUR_ALFRESCO_PASSWORD’;

3. Create alfresco documents and index folder

mkdir /usr/local/alfresco

4.Unpack alfresco-community-4.0.a.zip

unzip alfresco-community-4.0.a.zip

5. Configure Alfresco before deploying to glassfish

5.1 alfresco-global.properties

Since alfresco 3.3, all the settings now based on alfresco-global.properties. This file can be found from the alfresco package file alfresco-community-4.0.a.zip. Copy this file from the unzip location to  glassfish lib folder.

cd /alfresco-community-4.0.a/extensions/extension

cp alfresco-global.properties /usr/local/glassfish/domains/domain1/lib/classes/alfresco-global.properties

if Glassfish is installed at /usr/local/glassfish.

5.2 Modify alfresco-global.properties so alfresco can find database and index folder created before

Set alfresco folder
dir.root = /usr/local/alfresco

Set dababase username and password

db.username=YOUR_ALFRESCO_USERNAME
db.password=YOUR_ALFRESCO_PASSWORD
db.driver=org.gjt.mm.mysql.Driver
db.url=jdbc:mysql://localhost/alfresco

6. You need a ‘glassfish-web.xml’ for “useMyFaces” for alfresco. *ONLY needed if your using Glassfish 3.1 * – If using Glassfish 3.0 or below Skip to step 7/7.1 as that needs ‘sun-web.xml’.

7. sun-web.xml:

<?xml version=”1.0″ encoding=”UTF-8″?>
<!DOCTYPE sun-web-app PUBLIC “-//Sun Microsystems, Inc.//DTD Application Server 8.1 Servlet 2.4//EN”  “http://www.sun.com/software/appserver/dtds/sun-web-app_2_4-1.dtd”&gt;
<sun-web-app>
<class-loader delegate=”false”/>
<property name=”useMyFaces” value=”true”/>
</sun-web-app>

You can also get this file from http://blogs.sun.com/mandy/resource/sun-web.xml

7.1 Add sun-web.xml to alfresco.war

Go to the unpacked directory created from alfresco-community-4.0.a.zip, create a new directory named WEB-INF and put sun-web.xml on it.

cd /alfresco-community-4.0.a/

mkdir /WEB-INF/

cp /temp/sun-web.xml /WEB-INF/sun-web.xml

jar -uvf alfresco.war WEB-INF/*.xml

The alfresco.war should be edited.

8.  Increase glassfish memory heap setting
Log in as administrator of glassfish from http://glassfishHost:4848/
Application Server->JVM Settings->JVM Options
Change -Xmx256m to -Xmx512m or more.

9.  Deploy the new war file to glassfish.
Log in as administrator of glassshfish from http://glassfishHost:4848/ and deploy alfresco.war.
After a few minutes, alfreso can be visited by hppp://glassfishHost:8080/alfresco

10.  Deploy share

Log in as administrator of glassshfish from http://glassfishHost:4848/ and deploy share.war from the unzip package.

There is a bug in share.war, so you will get the “No ‘login’ page type configured – but page auth required it.”  error message if go to  http://glassfishHost:8080/share.

Solution is download the latest spring-surf-core-configservice-1.0.0.CI-SNAPSHOT.jar from alfresco SVN

wget http://svn.alfresco.com/repos/alfresco-open-mirror/alfresco/HEAD/root/projects/3rd-party/src/spring-surf-core-configservice-1.0.0.CI-SNAPSHOT.jar

cp spring-surf-core-configservice-1.0.0.CI-SNAPSHOT.jar /usr/local/glassfish/domains/domain1/applications/j2ee-modules/share/WEB-INF/lib/

Restart glassfish, go to http://Glassfishhost:8080/share

Should work!

You can also add the spring-surf-core-configservice-1.0.0.CI-SNAPSHOT.jar to the share.war and deploy it.

Alfresco community 3.2 installation on glassfish

1 Get alfresco war files for deployment in existing application servers package file  alfresco-community-war-3.2r2.tar.gz from http://wiki.alfresco.com/wiki/Community_Edition_file_list_32r2

2. MySql setting

mysql>create database alfresco;

mysql>grant all privileges on alfresco.* to ‘YOUR_ALFRESCO_USERNAME’@’%’ identified by ‘YOUR_ALFRESCO_PASSWORD’;

mysql>grant all privileges on alfresco.* to ‘YOUR_ALFRESCO_USERNAME’@’localhost’ identified by ‘YOUR_ALFRESCO_PASSWORD’;

3. Create alfresco libray folder on glassfish

mkdir /usr/lcoal/glassfish/domains/domain1/lib/classes/alfresco

4.Unpacke alfresco-community-war-3.2r2.tar.gz

tar vzxf alfresco-community-war-3.2r2.tar.gz

5. From the directory in which you unpacked the Alfresco bundle, copy the entire contents of the extensions directory to the glassfish domain library /usr/lcoal/glassfish/domains/domain1/lib/classes/alfresco

cp -rf extensions/*  /usr/lcoal/glassfish/domains/domain1/lib/classes/alfresco

6. Create alfresco documents and index folder

mkdir /usr/local/alfresco

7. Modify alfresco config files for glassfish (/usr/local/glassfish/domains/domain1/lib/classes/alfresco/extension)so alfresco can find database and index folder created before

two files should be edited

custom-repository.properties

custom-hibernate-dialog.properties

cd /usr/local/glassfish/domains/domain1/lib/classes/alfresco/extension
vi custom-repository.properties

Set alfresco folder
dir.root = /usr/local/alfresco

Set dababase username and password

db.username=YOUR_ALFRESCO_USERNAME
db.password=YOUR_ALFRESCO_PASSWORD

Comment out the lines for derby and uncomment the lines for MySQL

#db.driver=org.apache.derby.jdbc.EmbeddedDriver
#db.url=jdbc:derby:data/derby_data/alfrescocreate=true


db.driver=org.gjt.mm.mysql.Driver
db.url=jdbc:mysql://localhost/alfresco

In custom-hibernate-dialog.properties, comment out the line for Derby and uncomment the line for MySQL

8 The Alfresco war file has a WEB-INF/web.xml deployment descriptor that doesn’t comply with the DTD, you need to replace this file and add a Glassfish specific deployment descriptor that will allow Alfresco to use MyFaces instead of JSF.

Get these two files from http://blogs.sun.com/mandy/resource/web.xml, http://blogs.sun.com/mandy/resource/sun-web.xml

Change to the unpacked directory created from alfresco-community-war-3.2r2.tar.gz, create a new directory named WEB-INF and copy the above two files into it. Now update the alfresco.war file using the Java jar command

jar -uvf alfresco.war WEB-INF/*.xml

The alfresco.war should be edited.

9 Increase glassfish memory heap setting
Log in as administrator of glassfish from http://glassfishHost:4848/
Application Server->JVM Settings->JVM Options
Change -Xmx256m to -Xmx512m or more.

10 Deploy the new war file to glassfish.
Log in as administrator of glassshfish from http://glassfishHost:4848/ and deploy alfresco.war.
After a few minutes, alfreso can be visited by hppp://glassfishHost:8080/alfresco

Useful links:
http://blogs.sun.com/mandy/entry/alfresco_on_glassfish_revisited