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.