LDAP conflict with FUSE
ldsute May 18, 2010 4:54 PMHi, all -
I'm using Spring-LDAP to search against a local ApacheDS-hosted directory. This is done inside a bean call from a Camel route. Normally, I receive the following exception at runtime:
-
08:30:43,041 | ERROR | ice.handleIngest | DefaultErrorHandler | rg.apache.camel.processor.Logger 248 | Failed delivery for exchangeId: 081c035f-c286-4f2e-bcc5-d8a97e0045a1. Exhausted after delivery attempt: 1 caught: org.springframework.ldap.NotContextException: Not an instance of DirContext; nested exception is javax.naming.NotContextException: Not an instance of DirContext
org.springframework.ldap.NotContextException: Not an instance of DirContext; nested exception is javax.naming.NotContextException: Not an instance of DirContext
at org.springframework.ldap.support.LdapUtils.convertLdapException(LdapUtils.java:196)
at org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:319)
at org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:259)
at org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:571)
at org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:556)
at org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:411)
...
Caused by: javax.naming.NotContextException: Not an instance of DirContext
at javax.naming.directory.InitialDirContext.getURLOrDefaultInitDirCtx(InitialDirContext.java:92)
at javax.naming.directory.InitialDirContext.search(InitialDirContext.java:248)
at org.springframework.ldap.core.LdapTemplate$4.executeSearch(LdapTemplate.java:253)
at org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:293)
...
-
I'm using the latest version of FUSE (apache-servicemix-4.2.0-fuse-01-00). I can workaround this by running the following command at the Karaf prompt: "features:uninstall naming". My LDAP search then works properly.
I believe this is related to the following posts:
- https://cwiki.apache.org/SM/discussion-forums.html#nabble-p26001289
- http://forum.springsource.org/showthread.php?t=66889
- http://fusesource.com/forums/thread.jspa?threadID=1435
But I couldn't see a fix for this on any of those posts, and uninstalling the naming feature appears to be undesirable. Is there any fix in the works for this issue or better workaround that you all know of?
Thanks.
Justin