Skip to Content.
Sympa Menu

grouper-dev - [grouper-dev] RE: Error in LDAPSourceAdapter

Subject: Grouper Developers Forum

List archive

[grouper-dev] RE: Error in LDAPSourceAdapter


Chronological Thread 
  • From: Chris Hyzer <>
  • To: Gagné Sébastien <>, "" <>
  • Subject: [grouper-dev] RE: Error in LDAPSourceAdapter
  • Date: Wed, 28 Nov 2012 20:17:11 +0000
  • Accept-language: en-US

Looks good to me, anyone else?

 

Thanks,

Chris

 

From: [mailto:] On Behalf Of Gagné Sébastien
Sent: Wednesday, November 28, 2012 3:15 PM
To:
Subject: [grouper-dev] Error in LDAPSourceAdapter

 

Hi,

For some yet-unkown reason, we have a subject that were unable to create from ou production AD. The sAMAccountName is apparently “null”, but that’s not our problem : when doing the search, this subject will be returned as a null object (that’s ok), but then you use that object and it causes an exception that is then re-thrown as a SourceUnavailableException.

 

This is what I get from the logs, unfortunately, I don’t know what object caused it..

LdapSourceAdapter.createSubject(465) -  - No value for LDAP attribute "sAMAccountName". It is Grouper attribute "SubjectID".

 

Would it be possible to check if subject is null before using it ? Or have more informations about it ? This would allow the search to complete.

 

My suggested fix would be something like :

 

LdapSourceAdapter.java, line 428

FROM :

SearchResult si = (SearchResult) ldapResults.next();

      Attributes attributes = si.getAttributes();

               Subject subject = createSubject(attributes);

               if (noAttrSearch) ((LdapSubject)subject).setAttributesGotten(true);

               result.add(subject);

 

TO :

SearchResult si = (SearchResult) ldapResults.next();

               Attributes attributes = si.getAttributes();

               Subject subject = createSubject(attributes);

if (subject != null) {

               if (noAttrSearch) ((LdapSubject)subject).setAttributesGotten(true);

               result.add(subject);

} else {

    log.error("Failed to create subject with attributes: " + attributes); }

 

LdapSourceAdapter.java, line 466

FROM:

log.error("No value for LDAP attribute \"" + subjectIDAttributeName + "\". It is Grouper attribute \"SubjectID\".”);

 

TO :

log.error("No value for LDAP attribute \"" + subjectIDAttributeName + "\". It is Grouper attribute \"SubjectID\". Problem subject's attributes : " attributes);

 

 

Sébastien Gagné,     | Analyste en informatique

514-343-6111 x33844  | Université de Montréal,

                     | Pavillon Roger-Gaudry, local X-100-11

 




Archive powered by MHonArc 2.6.16.

Top of Page