Notices


 
 
LinkBack Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 11-May-2009, 10:16 PM
Junior Member
 
Join Date: May 2008
Posts: 7
kings36503 0 reputation points
Default weird! modifiction about users.

It is so weird!
I am a java developer, using novell ldap api, here is the situation:
there is a user "cn=foo,o=someorg", password is "123456".
1. get a connectionPool:
Code:
PoolManager poolManager = new PoolManager("192.168.0.1", 389, 10, 5, null);
2. bind a user:
Code:
LDAPConnection lc = poolManager.getBoundConnection("cn=foo,o=someorg", "123456".getBytes());
3. do some search action:

Code:
try {
	LDAPSearchResults searchResults = lc1.search("o=someorg",
					LDAPConnection.SCOPE_SUB, "cn=*", new String[] {
							"objectclass", "cn" }, false);
			System.out.println(searchResults);
			LDAPEntry entry = null;
			while(searchResults.hasMore())
			{
				entry = searchResults.next();
				System.out.println(entry);
				//lc1.disconnect();
			}
		} catch (LDAPException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		poolManager.makeConnectionAvailable(lc1);
console print LDAPEntry

4. delete this user:

lc.delete("cn=foo,o=someorg");

5. add the same user with the same password:

Code:
LDAPAttributeSet attributeSet = new LDAPAttributeSet();
			attributeSet.add(new LDAPAttribute("objectclass", new String(
					"inetOrgPerson")));
			attributeSet.add(new LDAPAttribute("cn", new String("foo")));
			attributeSet.add(new LDAPAttribute("sn", new String("foo")));
			attributeSet.add(new LDAPAttribute("userpassword", "123456"));
			LDAPEntry newEntry = new LDAPEntry("cn=foo,o=someorg", attributeSet);
			lc.add(newEntry);
6: repeat step 2 and 3.
got a exception:
Code:
LDAPException: Other (80) Other
LDAPException: Server Message: NDS error: transport failure (-625)
LDAPException: Matched DN: 
	at com.novell.ldap.LDAPResponse.getResultException(Unknown Source)
	at com.novell.ldap.LDAPResponse.chkResultCode(Unknown Source)
	at com.novell.ldap.LDAPSearchResults.next(Unknown Source)
	at net.risesoft.platform.TestLdap.main(TestLdap.java:61)
nds trance:
Code:
08:00:00 B48 LDAP: Failed to duplicate context 0x59270041 in DuplicateNDSContext, err = transport failure (-625)
08:00:00 B48 LDAP: Failed to duplicate context 0x59270041 in DuplicateConnContext, err = transport failure (-625)
08:00:00 B48 LDAP: nds_back_search: DuplicateConnContext for search failed, err = transport failure (-625)
ps: when i create the same user with different password, it goes right.
weird! is'nt it ?
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -6. The time now is 08:55 AM.


© 2007 Novell, Inc. All Rights Reserved.

Search Engine Friendly URLs by vBSEO 3.3.0 RC2