cancel
Showing results for 
Search instead for 
Did you mean: 

NTLM + LDAP: Import of Groups failed on reference-view

schneika
Champ in-the-making
Champ in-the-making
I use ntlm-authentication and ldap sync for user/group (from an MS W2K3 ADS).
NTLM-Autologin and User-Sync/Import already works with my ldap-configuration.
But the Sync/Import of groups fails because of an corrupt reference-view of one single group. Whats going wrong in my case with the quartz-importer-job?

ldap-authentication-context.xml:

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>

<beans>
   
    <!–
        This bean is used to support general LDAP authentication. It is also used to provide read only access to users and groups
    to pull them out of the LDAP reopsitory
      –>
   
    <bean id="ldapInitialDirContextFactory" class="org.alfresco.repo.security.authentication.ldap.LDAPInitialDirContextFactoryImpl">
        <property name="initialDirContextEnvironment">
            <map>
                <!– The LDAP provider –>
                <entry key="java.naming.factory.initial">
                    <value>com.sun.jndi.ldap.LdapCtxFactory</value>
                </entry>
               
                <!– The url to the LDAP server –>
                <!– Note you can use space separated urls - they will be tried in turn until one works –>
                <!– This could be used to authenticate against one or more ldap servers (you will not know which one ….) –>
                <entry key="java.naming.provider.url">
                    <value>ldap://171.15.132.16:389</value>
                </entry>
               
                <!– The authentication mechanism to use      –>
                <!– Some sasl authentication mechanisms may require a realm to be set –>
                <!–                java.naming.security.sasl.realm –>
                <!– The available options will depend on your LDAP provider –>
                <entry key="java.naming.security.authentication">
                    <value>simple</value>
                </entry>
               
                <!– The id of a user who can read group and user information –>
                <!– This does not go through the pattern substitution defined above and is used "as is" –>
                <entry key="java.naming.security.principal">
                    <value>DOMAIN\user</value>
                </entry>
               
                <!– The password for the user defined above –>
                <entry key="java.naming.security.credentials">
                    <value>password</value>
                </entry>
            </map>
        </property>
    </bean>
   
    <!– Ldap Syncronisation support –>
   
    <!–
       
    There can be more than one stack of beans that import users or groups. For example, it may be easier
    to have a version of ldapPeopleExportSource, and associated beans, for each sub-tree of your ldap directory
    from which you want to import users. You could then limit users to be imported from two or more sub tress and ignore
    users found else where. The same applies to the import of groups.
        
    The defaults shown below are for OpenLDAP.   
       
    –>
       
  
    <!– Extract user information from LDAP and transform this to XML –>
    
    <bean id="ldapPeopleExportSource" class="org.alfresco.repo.security.authentication.ldap.LDAPPersonExportSource">
        <!–
        The query to select objects that represent the users to import.
       
        For Open LDAP, using a basic schema, the following is probably what you want:
        (objectclass=inetOrgPerson)
       
        For Active Directory:
        (objectclass=user)
        –>
        <property name="personQuery">
            <value>(objectclass=user)</value>
        </property>
       
        <!–
        The seach base restricts the LDAP query to a sub section of tree on the LDAP server.
        –>
        <property name="searchBase">
            <value>ou=users,dc=intra,dc=ads-root,dc=de</value>
        </property>
       
        <!–
        The unique identifier for the user.
       
        THIS MUST MATCH WHAT THE USER TYPES IN AT THE LOGIN PROMPT   
       
        For simple LDAP authentication this is likely to be "cn" or, less friendly, "distinguishedName"
       
        In OpenLDAP, using other authentication mechanisms "uid", but this depends on how you map
        from the id in the LDAP authentication request to search for the inetOrgPerson against which
        to authenticate.
       
        In Active Directory this is most likely to be "sAMAccountName"
       
        This property is mandatory and must appear on all users found by the query defined above.
       
        –>
        <property name="userIdAttributeName">
            <value>sAMAccountName</value>
        </property>
       
        <!– Services –>
        <property name="LDAPInitialDirContextFactory">
            <ref bean="ldapInitialDirContextFactory"/>
        </property>
        <property name="personService">
            <ref bean="personService"></ref>
        </property>
        <property name="namespaceService">
            <ref bean="namespaceService"/>
        </property>
       
        <!–
        This property defines a mapping between attributes held on LDAP user objects and
        the properties of user objects held in the repository. The key is the QName of an attribute in
        the repository, the value is the attribute name from the user/inetOrgPerson/.. object in the
        LDAP repository.    
        –>
        <property name="attributeMapping">
            <map>
                <entry key="cm:userName">
                    <!– Must match the same attribute as userIdAttributeName –>
                    <value>sAMAccountName</value>
                </entry>
                <entry key="cm:firstName">
                    <!– OpenLDAP: "givenName" –>
                    <!– Active Directory: "givenName" –>
                    <value>givenName</value>
                </entry>
                <entry key="cm:lastName">
                    <!– OpenLDAP: "sn" –>
                    <!– Active Directory: "sn" –>
                    <value>sn</value>
                </entry>
                <entry key="cm:email">
                    <!– OpenLDAP: "mail" –>
                    <!– Active Directory: "???" –>
                    <value>mail</value>
                </entry>
                <entry key="cm:organizationId">
                    <!– OpenLDAP: "o" –>
                    <!– Active Directory: "???" –>
                    <value>msExchALObjectVersion</value>
                </entry>
                <!– Always use the default –>
                <entry key="cm:homeFolderProvider">
                    <null/>
                </entry>
            </map>
        </property>
        <!– Set a default home folder provider –>
        <!– Defaults only apply for values above –>
        <property name="attributeDefaults">
            <map>
                <entry key="cm:homeFolderProvider">
                    <value>userHomesHomeFolderProvider</value>
                </entry>
            </map>
        </property>
    </bean>
   
    <!– Extract group information from LDAP and transform this to XML –>
   
    <bean id="ldapGroupExportSource" class="org.alfresco.repo.security.authentication.ldap.LDAPGroupExportSource">
        <!–
        The query to select objects that represent the groups to import.
       
        For Open LDAP, using a basic schema, the following is probably what you want:
        (objectclass=groupOfNames)
       
        For Active Directory:
        (objectclass=group)
        –>
        <property name="groupQuery">
            <value>(objectclass=group)</value>
        </property>
       
        <!–
        The seach base restricts the LDAP query to a sub section of tree on the LDAP server.
        –>
        <property name="searchBase">
            <value>ou=groups,ou=_Global,dc=intra,dc=ads-root,dc=de</value>
        </property>
       
        <!–
        The unique identifier for the user. This must match the userIdAttributeName on the ldapPeopleExportSource bean above.
        –>
        <property name="userIdAttributeName">
            <value>sAMAccountName</value>
        </property>
       
        <!–
        An attribute that is a unique identifier for each group found.
        This is also the name of the group with the current group implementation.
        This is mandatory for any groups found.
       
        OpenLDAP: "cn" as it is mandatory on groupOfNames
        Active Directory: "cn"
       
        –>
        <property name="groupIdAttributeName">
            <value>cn</value>
        </property>
       
        <!–
        The objectClass attribute for group members.
        For each member of a group, the distinguished name is given.
        The object is looked up by its DN. If the object is of this class it is treated as a group.
        –>
        <property name="groupType">
            <value>group</value>
        </property>
       
        <!–
        The objectClass attribute for person members.
        For each member of a group, the distinguished name is given.
        The object is looked up by its DN. If the object is of this class it is treated as a person.
        –>
        <property name="personType">
            <value>user</value>
        </property>
        <property name="LDAPInitialDirContextFactory">
            <ref bean="ldapInitialDirContextFactory"/>
        </property>
        <property name="namespaceService">
            <ref bean="namespaceService"/>
        </property>
       
        <!–
        The repeating attribute on group objects (found by query or as sub groups)
        used to define membership of the group. This is assumed to hold distinguished names of
        other groups or users/people; the above types are used to determine this.
       
        OpenLDAP: "member" as it is mandatory on groupOfNames
        Active Directory: "member"
       
        –>
        <property name="memberAttribute">
            <value>member</value>
        </property>
       
        <property name="authorityDAO">
            <ref bean="authorityDAO"/>
        </property>
    </bean>
   
    <!– Job definitions to import LDAP people and groups –>
    <!– The triggers register themselves with the scheduler –>
    <!– You may comment in the default scheduler to enable these triggers –>
    <!– If a cron base trigger is what you want seee scheduled-jobs-context.xml for examples. –>
   
    <!– Trigger to load poeple –>
    <!– Note you can have more than one initial (context, trigger, import job and export source) set –>
    <!– This would allow you to load people from more than one ldap store –>
   
    <bean id="ldapPeopleTrigger" class="org.alfresco.util.TriggerBean">
        <property name="jobDetail">
            <bean id="ldapPeopleJobDetail" class="org.springframework.scheduling.quartz.JobDetailBean">
                <property name="jobClass">
                    <value>org.alfresco.repo.importer.ImporterJob</value>
                </property>
                <property name="jobDataAsMap">
                    <map>
                        <entry key="bean">
                            <ref bean="ldapPeopleImport"/>
                        </entry>
                    </map>
                </property>
            </bean>
        </property>
        <!– Start after 5 minutes of starting the repository –>
        <property name="startDelay">
            <value>300000</value>
        </property>
        <!– Repeat every hour –>
        <property name="repeatInterval">
            <value>3600000</value>
        </property>
        <!– Commented out to disable–>
        <property name="scheduler">
            <ref bean="schedulerFactory" />
        </property>
   
    </bean>
   
    <bean id="ldapGroupTrigger" class="org.alfresco.util.TriggerBean">
        <property name="jobDetail">
            <bean id="ldapGroupJobDetail" class="org.springframework.scheduling.quartz.JobDetailBean">
                <property name="jobClass">
                    <value>org.alfresco.repo.importer.ImporterJob</value>
                </property>
                <property name="jobDataAsMap">
                    <map>
                        <entry key="bean">
                            <ref bean="ldapGroupImport"/>
                        </entry>
                    </map>
                </property>
            </bean>
        </property>
        <!– Start after 5 minutes of starting the repository –>
        <property name="startDelay">
            <value>300000</value>
        </property>
        <!– Repeat every hour –>
        <property name="repeatInterval">
            <value>3600000</value>
        </property>
        <!– Commented out to disable
–>
        <property name="scheduler">
            <ref bean="schedulerFactory" />
        </property>
       
    </bean>
   
    <!– The bean that imports xml describing people –>
   
    <bean id="ldapPeopleImport" class="org.alfresco.repo.importer.ExportSourceImporter">
        <property name="importerService">
            <ref bean="importerComponentWithBehaviour"/>
        </property>
        <property name="transactionService">
            <ref bean="transactionComponent"/>
        </property>
        <property name="authenticationComponent">
            <ref bean="authenticationComponent"/>
        </property>
        <property name="exportSource">
            <ref bean="ldapPeopleExportSource"/>
        </property>

        <!– The store that contains people - this should not be changed –>
        <property name="storeRef">
            <value>${spaces.store}</value>
        </property>
       
        <!– The location of people nodes within the store defined above - this should not be changed –>
        <property name="path">
            <value>/${system.system_container.childname}/${system.people_container.childname}</value>
        </property>
       
        <!– If true, clear all existing people before import, if false update/add people from the xml –>
        <property name="clearAllChildren">
            <value>false</value>
        </property>
        <property name="nodeService">
            <ref bean="nodeService"/>
        </property>
        <property name="searchService">
            <ref bean="searchService"/>
        </property>
        <property name="namespacePrefixResolver">
            <ref bean="namespaceService"/>
        </property>
       
       
        <property name="caches">
            <set>
                <ref bean="permissionsAccessCache"/>
            </set>
        </property>
    </bean>
   
    <!– The bean that imports xml descibing groups –>
   
    <bean id="ldapGroupImport" class="org.alfresco.repo.importer.ExportSourceImporter">
        <property name="importerService">
            <ref bean="importerComponentWithBehaviour"/>
        </property>
        <property name="transactionService">
            <ref bean="transactionComponent"/>
        </property>
        <property name="authenticationComponent">
            <ref bean="authenticationComponent"/>
        </property>
        <property name="exportSource">
            <ref bean="ldapGroupExportSource"/>
        </property>
        <!– The store that contains group information - this should not be changed –>
        <property name="storeRef">
            <value>${alfresco_user_store.store}</value>
        </property>
       
        <!– The location of group information in the store above - this should not be changed –>
        <property name="path">
            <value>/${alfresco_user_store.system_container.childname}/${alfresco_user_store.authorities_container.childname}</value>
        </property>
       
        <!– If true, clear all existing groups before import, if false update/add groups from the xml –>
        <property name="clearAllChildren">
            <value>false</value>
        </property>
        <property name="nodeService">
            <ref bean="nodeService"/>
        </property>
        <property name="searchService">
            <ref bean="searchService"/>
        </property>
        <property name="namespacePrefixResolver">
            <ref bean="namespaceService"/>
        </property>
       
        <!– caches to clear on import of groups –>
        <property name="caches">
            <set>
                <ref bean="userToAuthorityCache"/>
                <ref bean="permissionsAccessCache"/>
            </set>
        </property>
       
        <!– userToAuthorityCache –>
    </bean>
   
</beans>

Thos ist my alfresco.log

03:55:14,857 ERROR [org.quartz.core.JobRunShell] Job DEFAULT.ldapGroupJobDetail threw an unhandled Exception: 
org.alfresco.repo.importer.ExportSourceImporterException: Failed to import
   at org.alfresco.repo.importer.ExportSourceImporter.doImport(ExportSourceImporter.java:214)
   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)
Caused by: org.alfresco.service.cmr.view.ImporterException: Failed to import package at line 28005; column 70 due to error: Cannot find node referenced by id de18f071-7744-11dc-a630-554e9464f39d
   at org.alfresco.repo.importer.view.ViewParser.parse(ViewParser.java:190)
   at org.alfresco.repo.importer.ImporterComponent.parserImport(ImporterComponent.java:360)
   at org.alfresco.repo.importer.ImporterComponent.importView(ImporterComponent.java:224)
   at org.alfresco.repo.importer.ExportSourceImporter.doImport(ExportSourceImporter.java:182)
   … 3 more
Caused by: org.alfresco.service.cmr.view.ImporterException: Cannot find node referenced by id de18f071-7744-11dc-a630-554e9464f39d
   at org.alfresco.repo.importer.view.ViewParser.processStartReference(ViewParser.java:461)
   at org.alfresco.repo.importer.view.ViewParser.processStartElement(ViewParser.java:259)
   at org.alfresco.repo.importer.view.ViewParser.parse(ViewParser.java:176)
   … 6 more
03:55:14,858 ERROR [org.quartz.core.ErrorLogger] Job (DEFAULT.ldapGroupJobDetail threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: org.alfresco.repo.importer.ExportSourceImporterException: Failed to import]
   at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
   at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
Caused by: org.alfresco.repo.importer.ExportSourceImporterException: Failed to import
   at org.alfresco.repo.importer.ExportSourceImporter.doImport(ExportSourceImporter.java:214)
   at org.alfresco.repo.importer.ImporterJob.execute(ImporterJob.java:44)
   at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
   … 1 more
Caused by: org.alfresco.service.cmr.view.ImporterException: Failed to import package at line 28005; column 70 due to error: Cannot find node referenced by id de18f071-7744-11dc-a630-554e9464f39d
   at org.alfresco.repo.importer.view.ViewParser.parse(ViewParser.java:190)
   at org.alfresco.repo.importer.ImporterComponent.parserImport(ImporterComponent.java:360)
   at org.alfresco.repo.importer.ImporterComponent.importView(ImporterComponent.java:224)
   at org.alfresco.repo.importer.ExportSourceImporter.doImport(ExportSourceImporter.java:182)
   … 3 more
Caused by: org.alfresco.service.cmr.view.ImporterException: Cannot find node referenced by id de18f071-7744-11dc-a630-554e9464f39d
   at org.alfresco.repo.importer.view.ViewParser.processStartReference(ViewParser.java:461)
   at org.alfresco.repo.importer.view.ViewParser.processStartElement(ViewParser.java:259)
   at org.alfresco.repo.importer.view.ViewParser.parse(ViewParser.java:176)
   … 6 more

Please anybody can help?
2 REPLIES 2

schneika
Champ in-the-making
Champ in-the-making
How can i disable these import of reference views from the LDAP-Groups?

Here a snippet of the ExportSourceImporter.xml-File in \tomcat\temp\Alfresco:

<?xml version="1.0" encoding="UTF-8"?>
<view:view xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:view="http://www.alfresco.org/view/repository/1.0" xmlns:d="http://www.alfresco.org/model/dictionary/1.0" xmlns:alf="http://www.alfresco.org" xmlns:act="http://www.alfresco.org/model/action/1.0" xmlns:wf="http://www.alfresco.org/model/workflow/1.0" xmlns:app="http://www.alfresco.org/model/application/1.0" xmlns:usr="http://www.alfresco.org/model/user/1.0" xmlns:ver="http://www.alfresco.org/model/versionstore/1.0" xmlns:cm="http://www.alfresco.org/model/content/1.0" xmlns:sv="http://www.jcp.org/jcr/sv/1.0" xmlns:my="my.new.model" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:wcm="http://www.alfresco.org/model/wcmmodel/1.0" xmlns:wca="http://www.alfresco.org/model/wcmappmodel/1.0" xmlns:sys="http://www.alfresco.org/model/system/1.0" xmlns:wcmwf="http://www.alfresco.org/model/wcmworkflow/1.0" xmlns:rule="http://www.alfresco.org/model/rule/1.0" xmlns:bpm="http://www.alfresco.org/model/bpm/1.0" xmlns:fm="http://www.alfresco.org/model/forum/1.0" xmlns:reg="http://www.alfresco.org/system/registry/1.0" xmlns:module="http://www.alfresco.org/system/modules/1.0" xmlns="">
   </usr:authorityContainer>
   <usr:authorityContainer view:childName="usr:GROUP_GGO_PROTOKOLLE" view:id="de1260de-7744-11dc-a630-554e9464f39d">
      <usr:authorityName>GROUP_GGO_PROTOKOLLE</usr:authorityName>
      <usr:members>
         <view:value>1name</view:value>
         <view:value>2name</view:value>
         <view:value>3name</view:value>
         <view:value>4name</view:value>
         <view:value>5name</view:value>
      </usr:members>
   </usr:authorityContainer>
   <usr:authorityContainer view:childName="usr:GROUP_Webmaster" view:id="ddf5b181-7744-11dc-a630-554e9464f39d">
      <usr:authorityName>GROUP_Webmaster</usr:authorityName>
      <usr:members>
         <view:value>name6</view:value>
         <view:value>name7</view:value>
         <view:value>name8</view:value>
         <view:value>name9</view:value>
      </usr:members>
   </usr:authorityContainer>
   <view:reference view:idref="de17b7bc-7744-11dc-a630-554e9464f39d">
      <view:associations>
         <usr:member>
            <view:reference view:idref="de14d228-7744-11dc-a630-554e9464f39d" view:childName="usr:GROUP_GGO_ADMIN"></view:reference>
         </usr:member>
      </view:associations>
   </view:reference>
   <view:reference view:idref="de1483fe-7744-11dc-a630-554e9464f39d">
      <view:associations>
         <usr:member>
            <view:reference view:idref="de185417-7744-11dc-a630-554e9464f39d" view:childName="usr:GROUP_GGA_LAGER"></view:reference>
         </usr:member>
      </view:associations>
   </view:reference>
   <view:reference view:idref="de156e7e-7744-11dc-a630-554e9464f39d">
      <view:associations>
         <usr:member>
            <view:reference view:idref="de16f457-7744-11dc-a630-554e9464f39d" view:childName="usr:GROUP_GGA_VERTRIEBID"></view:reference>
         </usr:member>
      </view:associations>
   </view:reference>
   <view:reference view:idref="de171b68-7744-11dc-a630-554e9464f39d">
      <view:associations>
         <usr:member>
            <view:reference view:idref="de16a630-7744-11dc-a630-554e9464f39d" view:childName="usr:GROUP_GGO_intern-AM-Systemberatung"></view:reference>
         </usr:member>
      </view:associations>
   </view:reference>
   <view:reference view:idref="de01984a-7744-11dc-a630-554e9464f39d">
      <view:associations>
         <usr:member>
            <view:reference view:idref="ddff2706-7744-11dc-a630-554e9464f39d" view:childName="usr:GROUP_M_VERTRAGSWESEN"></view:reference>
         </usr:member>
      </view:associations>
   </view:reference>
   <view:reference view:idref="de18f071-7744-11dc-a630-554e9464f39d">
      <view:associations>
         <usr:member>
            <view:reference view:idref="de18a23f-7744-11dc-a630-554e9464f39d" view:childName="usr:GROUP_GGA_BIBI_GS"></view:reference>
         </usr:member>
      </view:associations>
   </view:reference>
      <view:reference view:idref="de0f051c-7744-11dc-a630-554e9464f39d">
      <view:associations>
         <usr:member>
            <view:reference view:idref="de071606-7744-11dc-a630-554e9464f39d" view:childName="usr:GROUP_GGA_ENTWICKLUNG"></view:reference>
         </usr:member>
      </view:associations>
   </view:reference>
</view:view>

andy
Champ on-the-rise
Champ on-the-rise
Hi

Which version of Alfresco are you using?

It sounds like a single group is causing the problem.
Can you find this group via the UI?

Configure the group importer to clear out all groups first.
(you must not do this for users or you will get odd errors every so often …)

       <property name="clearAllChildren">
            <value>false</value>
        </property>

Andy