L.S., Claus was referring to Camel's registry to hold the reference to the DirContext instance. This isn't necessarily a real JNDI context, Camel can also look in e.g. a Spring or Guice context to look up the bean.
For servicemix-camel, the most convenient way to handle this is by creating a <bean /> in the camel-context.xml file where the bean id matches the host/port you specified on the connection URL. This way, Camel will use the bean for accessing the LDAP directory. The syntax for creating the bean is just plain Spring XML, nothing special there. You can either try to create a DirContext bean there yourself, but it might be worth taking a look at the Spring LDAP project and using a DirSource object as a factory for a DirContext, e.g. org.springframework.ldap.support.LdapContextSource seems to have a promising start. Haven't tried it myself though, but feel free to let me know if you run into any more problems while trying this out. Regards, Gert Vanthienen ------------------------ Open Source SOA: http://fusesource.com Blog: http://gertvanthienen.blogspot.com/ 2009/4/6 angeloNZ <[email protected]>: > > Hi, > > I posted a question in the camel-users forum regarding the use of the > camel-ldap component > http://www.nabble.com/Help-with-implementing-LDAP-solution-td22862000.html#a22865433 > here . I'm trying to achieve a solution within servicemix3.3 where I could > use the camel-ldap component from within my RouteBuilder class to do a LDAP > lookup based on a username value I'm expecting as part of an http request. > I've seen the docs for camel-ldap where I can specify the host, port, > basename and scope in a provider url like: > > from().to("ldap://<host>:<port>?<basename>=..." > > My question is, from within SM, do I need to configure a JNDI entry in > jndi.xml for my camel-ldap connection to work? I've looked around the forum > for an example ldap configuration but all I found are definitions made to > the login.properties file to authenticate incoming requests which is > different from what I'm doing. I'd like to see some jndi ldap configuration > examples with values for connectionPassword etc... > > Any other suggestions on how to achieve this is highly welcome. Thanks. > -- > View this message in context: > http://www.nabble.com/How-to-use-camel-ldap-component-in-ServiceMix-3.3.--Example-JNDI-entry-for-LDAP-needed.-tp22900321p22900321.html > Sent from the ServiceMix - User mailing list archive at Nabble.com. > >
