cancel
Showing results for 
Search instead for 
Did you mean: 

LDAP sync don´t work (Alfresco 3.0 on Ubuntu)

agey
Champ in-the-making
Champ in-the-making
Hi all,

I have a server with Alfresco 3.0 on Windows XP. Alfresco authentication use LDAP and it works fine. The syncronization between Alfresco and LDAP works fine too. The problen is when I install Alfresco 3.0 on Ubuntu with the same configuration. LDAP authentication works fine but syncronization don´t work. This is the error:


15:50:00,090 ERROR [org.quartz.core.JobRunShell] Job DEFAULT.ldapPeopleJobDetail threw an unhandled Exception:
java.lang.NullPointerException
        at org.alfresco.repo.importer.ExportSourceImporter.doImport(ExportSourceImporter.java:218)
        at org.alfresco.repo.importer.ImporterJob.execute(ImporterJob.java:44)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
15:50:00,093 ERROR [org.quartz.core.ErrorLogger] Job (DEFAULT.ldapPeopleJobDetail threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: java.lang.NullPointerException]
        at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
Caused by: java.lang.NullPointerException
        at org.alfresco.repo.importer.ExportSourceImporter.doImport(ExportSourceImporter.java:218)
        at org.alfresco.repo.importer.ImporterJob.execute(ImporterJob.java:44)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
        … 1 more

This is my configuration in both servers (Windows and Ubuntu):

ldap-authentication.properties

#
# This properties file brings together the common options for LDAP authentication rather than editing the bean definitions
#

ldap.authentication.active=true

# How to map the user id entered by the user to taht passed through to LDAP
# - simple
#    - this must be a DN and would be something like
#      CN=%s,DC=company,DC=com
# - digest
#    - usually pass through what is entered
#      %s    
#ldap.authentication.userNameFormat=%s
ldap.authentication.userNameFormat=cn\=%s,ou\=people,dc\=alfresco,dc\=sample,dc\=sm

# The LDAP context factory to use
ldap.authentication.java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory

# The URL to connect to the LDAP server
#ldap.authentication.java.naming.provider.url=ldap://openldap.domain.com:389
ldap.authentication.java.naming.provider.url=ldap://192.168.2.30:389

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

# The default principal to use (only used for LDAP sync)
#ldap.authentication.java.naming.security.principal=reader
#ldap.authentication.java.naming.security.principal=admin
ldap.authentication.java.naming.security.principal=cn=admin,dc=alfresco,dc=sample,dc=sm

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

# Escape commas entered by the user at bind time
# Useful when using simple authentication and the CN is part of the DN and contains commas
ldap.authentication.escapeCommasInBind=false

# Escape commas entered by the user when setting the authenticated user
# Useful when using simple authentication and the CN is part of the DN and contains commas, and the escaped \, is
# pulled in as part of an LDAP sync
# If this option is set to true it will break the default home folder provider as space names can not contain \
ldap.authentication.escapeCommasInUid=false

ldap-synchronisation.properties

#
# This properties file is used to configure LDAP syncronisation
#

ldap.synchronization.active=true

# The query to find the people to import
#ldap.synchronisation.personQuery=(objectclass=inetOrgPerson)
ldap.synchronisation.personQuery=(objectclass\=inetOrgPerson)

# The search base of the query to find people to import
#ldap.synchronisation.personSearchBase=dc=company,dc=com
#ldap.synchronisation.personSearchBase=ou\=people,dc\=alfresco,dc\=sample,dc\=sm
ldap.synchronisation.personSearchBase=dc\=alfresco,dc\=sample,dc\=sm

# The attribute name on people objects found in LDAP to use as the uid in Alfresco
#ldap.synchronisation.userIdAttributeName=uid
ldap.synchronisation.userIdAttributeName=cn

# The attribute on person objects in LDAP to map to the first name property in Alfresco
ldap.synchronisation.userFirstNameAttributeName=givenName

# The attribute on person objects in LDAP to map to the last name property in Alfresco
ldap.synchronisation.userLastNameAttributeName=sn

# The attribute on person objects in LDAP to map to the email property in Alfresco
ldap.synchronisation.userEmailAttributeName=mail

# The attribute on person objects in LDAP to map to the organizational id  property in Alfresco
ldap.synchronisation.userOrganizationalIdAttributeName=o

# The default home folder provider to use for people created via LDAP import
#ldap.synchronisation.defaultHomeFolderProvider=personalHomeFolderProvider
ldap.synchronisation.defaultHomeFolderProvider=userHomesHomeFolderProvider

# The query to find group objects
#ldap.synchronisation.groupQuery=(objectclass=groupOfNames)
ldap.synchronisation.groupQuery=(objectclass\=groupOfUniqueNames)

# The search base to use to find group objects
#ldap.synchronisation.groupSearchBase=dc=company,dc=com
#ldap.synchronisation.groupSearchBase=ou\=groups,dc\=alfresco,dc\=sample,dc\=sm
ldap.synchronisation.groupSearchBase=dc\=alfresco,dc\=sample,dc\=sm

# The attribute on LDAP group objects to map to the gid property in Alfrecso
ldap.synchronisation.groupIdAttributeName=cn

# The group type in LDAP
#ldap.synchronisation.groupType=groupOfNames
ldap.synchronisation.groupType=groupOfUniqueNames

# The person type in LDAP
ldap.synchronisation.personType=inetOrgPerson

# The attribute in LDAP on group objects that defines the DN for its members
#ldap.synchronisation.groupMemberAttributeName=member
ldap.synchronisation.groupMemberAttributeName=uniqueMember

# The cron expression defining when people imports should take place
ldap.synchronisation.import.person.cron=0 */10 * * * ?

# The cron expression defining when group imports should take place
ldap.synchronisation.import.group.cron=0 */20 * * * ?

# Should all groups be cleared out at import time?
# - this is safe as groups are not used in Alfresco for other things (unlike person objects which you should never clear out during an import)
# - setting this to true means old group definitions will be tidied up.
#ldap.synchronisation.import.group.clearAllChildren=true
ldap.synchronisation.import.group.clearAllChildren=true

synchronization.synchronizeChangesOnly=false
synchronization.syncOnStartup=true
synchronization.syncWhenMissingPeopleLogIn=true
synchronization.autoCreatePeopleOnLogin=false

Does anyone know what could be the problem? Can anyone point me how can I solve it?

Thanks a lot in advance,
2 REPLIES 2

abhashree
Champ in-the-making
Champ in-the-making
Hi Agey,

Please follow the link http://forums.alfresco.com/en/viewtopic.php?t=14737
I think this link may help you to solve your issue.

agey
Champ in-the-making
Champ in-the-making
Hi abhashree

Thank you very much for you reply.

I solved the problem. I had copied ldap-authentication.properties, ldap-authentication-context.xml, ldap-synchronisation.properties and ldap-synchronisation-context.xml from Alfresco v3.0 on Windows to Alfresco v3.0 on Ubuntu. Now I replaced ldap-authentication-context.xml and ldap-synchronisation-context.xml files by the original context files of Alfresco v3.0 on Ubuntu and synchronization works!  Smiley Very Happy

I checked the context files of the two Alfresco instalations and the difference is the "authenticationComponent" property declaration to "ldapPeopleImport" bean and "ldapGroupImport"  Smiley Surprisedops: :


<property name="authenticationComponent">
            <ref bean="authenticationComponent"/>
</property>