Java ldap修改AD属性报错

用Java ldap做一个域用户某一个属性信息修改功能

LdapContext ctx = xxx; 已经用域管理用户连接上了,没问题。

ModificationItem modificationItem[] =new ModificationItem[1]; modificationItem[0] = new ModificationItem(DirContext.REPLACE_ATTRIBUTE,new BasicAttribute("employeeID","123456")); //employeeID 是AD里面的一个属性 ctx.modifyAttributes("uid=robert,cn=users,DC=SMNPC,DC=COM",modificationItem);//就是执行 ctx.modifyAttributes 这句报错
下面是报错的异常信息
Exception in thread "main" javax.naming.NamingException: [LDAP: error code 1 - 000004DC: LdapErr: DSID-0C090B22, comment: In order to perform this operation a successful bind must be completed on the connection., data 0, v1db1
找了半天也不知道这个异常是什么原因造成的,求大家告知一下,顺便有Java ldap修改AD属性值的例子也可以分享一下给我呗

错误说是,当前操作失败是因为没有连接造成的,您确定ctx连接没有关闭吗?

http://wiki.servicenow.com/index.php?title=LDAP_Error_Codes
这网站是ldap的错误 ldap error 0 ~ ldap error 773 详解