justinkoke@gmail.com
May 23rd, 2007, 06:21 PM
Hi,
I am having a small problem with a customers Active Directory server and was hoping if someone has seen a similar error or can provide some guidance into where I can start digging!
I am performing a search on a Active Directory server using Spring LDAP, here are the general details of the search:
Base DN: dc=xxxx,dc=mycompany,dc=com
Filter = (&(cn=Group Policy Creator Owners)(objectCategory=Group))
Mapper:
public class DnContextMapper implements ContextMapper
{
public Object mapFromContext(Object ctx)
{
DirContextAdapter context = (DirContextAdapter) ctx;
return context.getDn();
}
When the search is being performed by LDAPTemplate:
specifically:
NamingEnumeration results = null;
try {
processor.preProcess(ctx);
results = se.executeSearch(ctx);
while (results.hasMore()) {
NameClassPair result = (NameClassPair) results.next();
handler.handleNameClassPair(result);
}
processor.postProcess(ctx);
} catch (NameNotFoundException e) {
...
The 'NamingEnumeration' appears to have just one result (looking at the entries Vector within the Enumeration), which is what I would expect. but when results.hasMore() is called a second result is found.
The First result is great:
"CN=Group Policy Creator Owners,OU=Groups,OU=Austin\, TX,DC=xxxx,DC=mycompany,DC=com"
But the second result is:
"ldap://adserver.xxx.mycompanyt.com:389/CN=Group%20Policy%20Creator%20Owners,OU=Groups,OU= Austin,DC=adserver,DC=xxx,DC=mycompany,DC=com"
So when the DistinguishedName DNParser tries to parse the DN an exception is thrown since this DN really is not a valid DN, it is a valid LDAP URL however.
So my general questions are:
Has anyone come across something like this before and does anyone have a general idea on how I should try and configure, or search with LDAPTemplate to try and stop this from occurring.
Cheers,
Justin
- at the moment I am trying to get a little bit more information from our customer regarding their AD setup
I am having a small problem with a customers Active Directory server and was hoping if someone has seen a similar error or can provide some guidance into where I can start digging!
I am performing a search on a Active Directory server using Spring LDAP, here are the general details of the search:
Base DN: dc=xxxx,dc=mycompany,dc=com
Filter = (&(cn=Group Policy Creator Owners)(objectCategory=Group))
Mapper:
public class DnContextMapper implements ContextMapper
{
public Object mapFromContext(Object ctx)
{
DirContextAdapter context = (DirContextAdapter) ctx;
return context.getDn();
}
When the search is being performed by LDAPTemplate:
specifically:
NamingEnumeration results = null;
try {
processor.preProcess(ctx);
results = se.executeSearch(ctx);
while (results.hasMore()) {
NameClassPair result = (NameClassPair) results.next();
handler.handleNameClassPair(result);
}
processor.postProcess(ctx);
} catch (NameNotFoundException e) {
...
The 'NamingEnumeration' appears to have just one result (looking at the entries Vector within the Enumeration), which is what I would expect. but when results.hasMore() is called a second result is found.
The First result is great:
"CN=Group Policy Creator Owners,OU=Groups,OU=Austin\, TX,DC=xxxx,DC=mycompany,DC=com"
But the second result is:
"ldap://adserver.xxx.mycompanyt.com:389/CN=Group%20Policy%20Creator%20Owners,OU=Groups,OU= Austin,DC=adserver,DC=xxx,DC=mycompany,DC=com"
So when the DistinguishedName DNParser tries to parse the DN an exception is thrown since this DN really is not a valid DN, it is a valid LDAP URL however.
So my general questions are:
Has anyone come across something like this before and does anyone have a general idea on how I should try and configure, or search with LDAPTemplate to try and stop this from occurring.
Cheers,
Justin
- at the moment I am trying to get a little bit more information from our customer regarding their AD setup