Sample ldif

60 views
Skip to first unread message

Jan Boon

unread,
Jul 4, 2011, 1:14:10 PM7/4/11
to Eureka Streams Development
Hi,

I got the following error message trying to lookup a person in
OpenLDAP that logs in with XXXXXX:

2011-07-04 18:25:54,711 DEBUG
org.eurekastreams.server.persistence.mappers.ldap.templateretrievers.SearchStringLdapTemplateRetriever
- No domain specified, searching only on ldap://ldap.example.com for :
XXXXXX
2011-07-04 18:25:54,711 TRACE
org.eurekastreams.server.persistence.mappers.ldap.PagedLdapSearchStrategy
- Beginning paged ldap search with 100 results per page. Filter:
(&(objectclass=inetOrgPerson)(cn=XXXXXX))
2011-07-04 18:25:54,720 DEBUG
org.eurekastreams.server.persistence.mappers.ldap.callback.LdapToPersonMapper
- Found person: Schmo
2011-07-04 18:25:54,720 ERROR
org.eurekastreams.server.persistence.mappers.ldap.callback.LdapToPersonMapper
- Error instantiating person object.
java.lang.NullPointerException
at
javax.naming.directory.BasicAttributes.get(BasicAttributes.java:161)
at
org.eurekastreams.server.persistence.mappers.ldap.callback.LdapToPersonMapper.mapFromAttributes(LdapToPersonMapper.java:
128)
at
org.springframework.ldap.core.AttributesMapperCallbackHandler.getObjectFromNameClassPair(AttributesMapperCallbackHandler.java:
62)
at
org.springframework.ldap.core.CollectingNameClassPairCallbackHandler.handleNameClassPair(CollectingNameClassPairCallbackHandler.java:
50)
at
org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:
297)
at
org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:
259)
at
org.eurekastreams.server.persistence.mappers.ldap.PagedLdapSearchStrategy.searchLdap(PagedLdapSearchStrategy.java:
93)
at
org.eurekastreams.server.persistence.mappers.ldap.LdapLookup.execute(LdapLookup.java:
116)
at
org.eurekastreams.server.service.actions.strategies.ldap.PersonLookupViaAttribute.findPeople(PersonLookupViaAttribute.java:
61)
at
org.eurekastreams.server.action.execution.CreatePersonFromLdapExecution.execute(CreatePersonFromLdapExecution.java:
87)
at
org.eurekastreams.server.action.execution.CreatePersonFromLdapExecution.execute(CreatePersonFromLdapExecution.java:
34)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
43)
at java.lang.reflect.Method.invoke(Method.java:616)
at
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:
307)


The found entry has been imported with the following ldif:

dn: cn=XXXXXX,ou=people,dc=example,dc=com
objectclass: inetOrgPerson
cn: XXXXXX
sn: Schmo
uid: jschmo
mail: j...@example.com
mail: j.s...@example.com
ou: sales

So the person is found in ldap but the person object could not be
initiated. Am I missing attributes? Any pointers (to another example
ldif) ?

Thanks in advance.

Regards Jan Boon.


Jan Boon

unread,
Jul 4, 2011, 1:49:54 PM7/4/11
to Eureka Streams Development
Looks like Eurekastreams is trying to map the email attribuut. But email is not allowed, not for objectclass Person and not for inetOrgPerson.

2011/7/4 Jan Boon <janbo...@gmail.com>

Rob Keane

unread,
Jul 4, 2011, 6:50:44 PM7/4/11
to Eureka Streams Development
It's looking for an attribute named "email"?

Have you overridden the value in sharedresources, see:
https://github.com/lmco/eurekastreams/blob/master/sharedresources/src/main/resources/org/eurekastreams/server/conf/applicationContext-framework-ldap.xml?

We do need to better document the LDAP attributes and how to set
them. If that doesn't work let me know, Trying to figure out if this
is a code defect, or just a problem due to missing docs.

On Jul 4, 1:49 pm, Jan Boon <janboon...@gmail.com> wrote:
> Looks like Eurekastreams is trying to map the email attribuut. But email is
> not allowed, not for objectclass Person and not for inetOrgPerson.
>
> 2011/7/4 Jan Boon <janboon...@gmail.com>
> > mail: j.sc...@example.com

Jan Boon

unread,
Jul 5, 2011, 2:11:38 AM7/5/11
to eureka-st...@googlegroups.com
Hi Rob,

Removed the nulpointer exception and got the person logged in.

Here are some extra debug lines in LdapToPersonMapper:

2011-07-05 07:48:03,132 DEBUG org.eurekastreams.server.persistence.mappers.ldap.callback.LdapToPersonMapper - fullNameAttrib: sn
2011-07-05 07:48:03,132 DEBUG org.eurekastreams.server.persistence.mappers.ldap.callback.LdapToPersonMapper - accountAttrib: sn
2011-07-05 07:48:03,133 DEBUG org.eurekastreams.server.persistence.mappers.ldap.callback.LdapToPersonMapper - firstNameAttrib: sn
2011-07-05 07:48:03,133 DEBUG org.eurekastreams.server.persistence.mappers.ldap.callback.LdapToPersonMapper - lastNameAttrib: sn
2011-07-05 07:48:03,133 DEBUG org.eurekastreams.server.persistence.mappers.ldap.callback.LdapToPersonMapper - emailAttrib: mail
2011-07-05 07:48:03,133 DEBUG org.eurekastreams.server.persistence.mappers.ldap.callback.LdapToPersonMapper - middleNameAttrib: initials
2011-07-05 07:48:03,133 DEBUG org.eurekastreams.server.persistence.mappers.ldap.callback.LdapToPersonMapper - orgAttrib: ou
2011-07-05 07:48:03,133 DEBUG org.eurekastreams.server.persistence.mappers.ldap.callback.LdapToPersonMapper - companyAttrib: o
2011-07-05 07:48:03,133 DEBUG org.eurekastreams.server.persistence.mappers.ldap.callback.LdapToPersonMapper - titleAttrib: title
2011-07-05 07:48:03,134 DEBUG org.eurekastreams.server.persistence.mappers.ldap.callback.LdapToPersonMapper - Found person: Schmo
2011-07-05 07:48:03,134 DEBUG org.eurekastreams.server.persistence.mappers.ldap.callback.LdapToPersonMapper - Company Name:TestCompany

The snippet from applicationContext-framework-ldap.xml:

    <bean id="ldapToPersonMapper"
        class="org.eurekastreams.server.persistence.mappers.ldap.callback.LdapToPersonMapper">
        <property name="accountAttrib" value="sn" />
        <property name="firstNameAttrib" value="sn" />
        <property name="lastNameAttrib" value="sn" />
        <property name="middleNameAttrib" value="initials" />
        <property name="companyAttrib" value="o" />
        <property name="orgAttrib" value="ou" />
        <property name="titleAttrib" value="title" />
        <property name="fullNameAttrib" value="sn" />
        <property name="emailAttrib" value="mail" />
        <property name="supportEmail" value="${eureka.mail.support.emailaddress}" />
    </bean>

And my ldif snippet:

dn: cn=XXXXXX,ou=people,dc=mylab,dc=com

objectclass: inetOrgPerson
cn: XXXXXX
sn: Schmo
initials : m.n.
mail: j.s...@example.com
o: TestCompany
ou: Sales
title: Senior

Do not kow exactly what caused the exception but default email is wrong, should be overridden by mail.
middleNameAttrib ---> initials,     should be something else but there is no equivalent in inetOrgPerson
o should be on a higher level.

Regards Jan.



2011/7/5 Rob Keane <rob....@gmail.com>

Jan Boon

unread,
Jul 5, 2011, 1:54:38 PM7/5/11
to eureka-st...@googlegroups.com
Resolving this issue raised another question.
Mind you I am still struggling finding my way in the complex architecture of Eurekastreams :-).

New employees found in ldap are inserted in the database. Removing them from the database does not remove them from the profiles-employees pages. I found out that only reindexing by Lucene will do this. To prove that I cleaned the Lucene directory from /tmp :-), something what Ubuntu seems to do with every reboot. And now I have empty profiles-employees-groups-suborgs pages (including error messages) like with any other page that is supposed to show a sorted (indexed) result. So the by Blake mentioned activity /#actions/reindexEntities looks very vital to me. But it does not seem to work. Is there some batch job that will reindex everything again and I get rid of the error messages in one go?

Regards Jan.




2011/7/5 Jan Boon <janbo...@gmail.com>

Rob Keane

unread,
Jul 5, 2011, 8:09:08 PM7/5/11
to eureka-st...@googlegroups.com
The only way to run the batch job to reindex is by going to that URL Blake pointed out. 
 
You said it doesn't work, are you seeing any errors?

Jan Boon

unread,
Jul 5, 2011, 10:07:55 PM7/5/11
to eureka-st...@googlegroups.com
Thank you Rob. Of course not any person logged in into the system can do that.  As Judy Sterling I got a success response (with a nice log) instead of a failure response. I think Ubuntu users should know this.

I am getting the big picture :-).

2011/7/6 Rob Keane <rob....@gmail.com>

Rob Keane

unread,
Jul 5, 2011, 10:40:27 PM7/5/11
to eureka-st...@googlegroups.com
Good point, that functionality is mostly undocumented, but very necessary.

#actions/warmCache is also useful as it will repopulate the in-memory cache, and is critical for consistent performance on larger instances of Eureka Streams.

I think I will work on putting together an FAQ and troubleshooting guide based on common questions on the this group.

uastan

unread,
Dec 10, 2011, 6:46:53 AM12/10/11
to eureka-st...@googlegroups.com
Hi

Rob, how is FAQ thing going on?

Rob Keane

unread,
Dec 11, 2011, 12:40:22 PM12/11/11
to eureka-st...@googlegroups.com
Haven't been able to make it a priority just yet, but hopefully by the
end of the year I'll be able to post something good.

If you have any specific questions let me know

ua stan

unread,
Jan 11, 2012, 9:52:35 AM1/11/12
to eureka-st...@googlegroups.com
LdapQuery parameter the one on settings page. What is safe value for it since asyncaction reports exceptions?


Reply all
Reply to author
Forward
0 new messages