Issue Details (XML | Word | Printable)

Key: LDAP-30
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Mattias Arthursson
Reporter: Domagoj Madunic
Votes: 1
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Spring LDAP

BadLdapGrammarException: RDN could not be parsed fully

Created: 03/Jan/07 07:41 PM   Updated: 12/May/07 05:32 AM
Component/s: None
Affects Version/s: None
Fix Version/s: 1.2-RC1

Time Tracking:
Not Specified

Environment: Windows XP, OpenLdap


 Description  « Hide
While trying to perform a simple search on InetOrgPersonObjects, via criteria uid=something

I encountered the following error:

org.acegisecurity.ldap.LdapDataAccessException: Failed to fetch user for username: dmadunic; nested exception is org.springframework.ldap.UncategorizedLdapExceptio n: Operation failed; nested exception is javax.naming.NamingException: problem generating object using object factory [Root exception is org.springframework.ldap.BadLdapGrammarException: RDN could not be parsed fully, remaining 'c']; remaining name 'ou=croz,ou=Users'
org.springframework.ldap.UncategorizedLdapExceptio n: Operation failed; nested exception is javax.naming.NamingException: problem generating object using object factory [Root exception is org.springframework.ldap.BadLdapGrammarException: RDN could not be parsed fully, remaining 'c']; remaining name 'ou=croz,ou=Users'
javax.naming.NamingException: problem generating object using object factory. Root exception is org.springframework.ldap.BadLdapGrammarException: RDN could not be parsed fully, remaining 'c'
at org.springframework.ldap.support.LdapEncoder.nameD ecode(LdapEncoder.java:226)
at org.springframework.ldap.support.LdapRdnComponent. <init>(LdapRdnComponent.java:69)
at org.springframework.ldap.support.DnParserImpl.attr ibuteTypeAndValue(DnParserImpl.java:112)
at org.springframework.ldap.support.DnParserImpl.rdn( DnParserImpl.java:62)
at org.springframework.ldap.support.DnParserImpl.dn(D nParserImpl.java:27)
at org.springframework.ldap.support.DistinguishedName .parse(DistinguishedName.java:130)
at org.springframework.ldap.support.DistinguishedName .<init>(DistinguishedName.java:89)
at org.springframework.ldap.support.DirContextAdapter .<init>(DirContextAdapter.java:131)
at org.springframework.ldap.support.DefaultDirObjectF actory.getObjectInstance(DefaultDirObjectFactory.j ava:56)
at javax.naming.spi.DirectoryManager.createObjectFrom Factories(DirectoryManager.java:228)
at javax.naming.spi.DirectoryManager.getObjectInstanc e(DirectoryManager.java:207)
at com.sun.jndi.ldap.LdapSearchEnumeration.createItem (LdapSearchEnumeration.java:118)
at com.sun.jndi.ldap.LdapNamingEnumeration.nextAux(Ld apNamingEnumeration.java:272)
at com.sun.jndi.ldap.LdapNamingEnumeration.nextImpl(L dapNamingEnumeration.java:252)
at com.sun.jndi.ldap.LdapNamingEnumeration.next(LdapN amingEnumeration.java:200)
at org.springframework.ldap.LdapTemplate.search(LdapT emplate.java:271)
at org.springframework.ldap.LdapTemplate.search(LdapT emplate.java:231)
at org.springframework.ldap.LdapTemplate.search(LdapT emplate.java:561)
at org.springframework.ldap.LdapTemplate.search(LdapT emplate.java:475)
at org.springframework.ldap.LdapTemplate.search(LdapT emplate.java:423)
at org.springframework.ldap.LdapTemplate.search(LdapT emplate.java:444)
...

This error occurs only with Ldap entires which have DN with national characters! When search is performed for entry with DN without national characters all goes well!



 All   Comments   Work Log   Change History   FishEye   Builds      Sort Order: Ascending order - Click to sort in descending order
Mattias Arthursson added a comment - 04/Jan/07 05:42 AM
LdapEncoder should be modified anyway - the nasty regexp in there should be replaced by something faster.

Domagoj Madunic added a comment - 16/Feb/07 04:49 AM
I was just wandering was there any progress in solving this issue?

Mattias Arthursson added a comment - 07/Mar/07 12:44 PM
Could you please specify the actual DN that caused this exception. Debugging will be much simplified.

Mattias Arthursson added a comment - 07/Mar/07 01:48 PM
Re-wrote LdapEncoder.nameDecode. Seems to be working, but it would be very useful to test it with the DN that caused the exception.

Domagoj Madunic added a comment - 11/Mar/07 04:41 AM
Hi,
i was on a trip for a few days and returned home only yestrday. So, the actual DN is:
cn=Domagoj Madunić,ou=Users,cn=CROZ,dc=uriel,dc=hr

I'll also give it a try after i finish unpacking....


Mattias Arthursson added a comment - 11/Mar/07 07:03 AM
Note that it's still not released. You'll have to download the latest 1.2 snapshot to try this out. I'd be very happy if you'd find the time though.

Mattias Arthursson added a comment - 11/Mar/07 07:04 AM
btw, the nightly snapshots are available here:
http://static.springframework.org/downloads/nightly/spring-ldap/

Mattias Arthursson added a comment - 31/Mar/07 05:56 AM
I'd still appreciate if we could get some help with testing it, but it does seem to be working, so I'm marking it resolved for now.