caikn
Aug 4th, 2006, 06:59 AM
Hello,
I am using the ldaptemplate 1.0.2 with Microsoft ActiveDirectory Server.
When I use the lookup method of ldaptemplate, I can't get any results. After using ethereal to analyse the LDAP request, I found out, that the lookup method always use search scope "Base (0x00)".
How can I tell ldaptemplate to use scope "Subtree" during lookup?
Thanks in advance
Kanyin
====LDAP Request when calling lookup method===
Base DN: CN=test,OU=myOrg,DC=myCompany,DC=com
Scope: Base (0X00)
Dereference: Always (0X03)
Size Limit: 0
Time Limit: 0
Attributes Only: False
Filter: (objectClass=*)
=====My context source==================
<beans>
<bean id="contextSource" class="net.sf.ldaptemplate.support.LdapContextSource">
<property name="url" value="ldap://myserver:389" />
<property name="base" value="DC=test,DC=com" />
<property name="userName" value="CN=testUser,CN=Users,DC=test,DC=com" />
<property name="password" value="****" />
<property name="dirObjectFactory" value="net.sf.ldaptemplate.support.DefaultDirObjectFactor y" />
</bean>
<bean id="ldapTemplate" class="net.sf.ldaptemplate.LdapTemplate">
<constructor-arg ref="contextSource" />
</bean>
<bean id="ldapDao" class="com.test.LdapDaoImpl">
<property name="ldapTemplate" ref="ldapTemplate" />
</bean>
</beans>
I am using the ldaptemplate 1.0.2 with Microsoft ActiveDirectory Server.
When I use the lookup method of ldaptemplate, I can't get any results. After using ethereal to analyse the LDAP request, I found out, that the lookup method always use search scope "Base (0x00)".
How can I tell ldaptemplate to use scope "Subtree" during lookup?
Thanks in advance
Kanyin
====LDAP Request when calling lookup method===
Base DN: CN=test,OU=myOrg,DC=myCompany,DC=com
Scope: Base (0X00)
Dereference: Always (0X03)
Size Limit: 0
Time Limit: 0
Attributes Only: False
Filter: (objectClass=*)
=====My context source==================
<beans>
<bean id="contextSource" class="net.sf.ldaptemplate.support.LdapContextSource">
<property name="url" value="ldap://myserver:389" />
<property name="base" value="DC=test,DC=com" />
<property name="userName" value="CN=testUser,CN=Users,DC=test,DC=com" />
<property name="password" value="****" />
<property name="dirObjectFactory" value="net.sf.ldaptemplate.support.DefaultDirObjectFactor y" />
</bean>
<bean id="ldapTemplate" class="net.sf.ldaptemplate.LdapTemplate">
<constructor-arg ref="contextSource" />
</bean>
<bean id="ldapDao" class="com.test.LdapDaoImpl">
<property name="ldapTemplate" ref="ldapTemplate" />
</bean>
</beans>