按Exception的信息,应该是我生成的记录信息不配置,可是我查过了ldap的Schema,觉得上面写的应该是够的了呀,难道我还是看错了?再说,这个例子是从sun网站下抄下来的,应该它本身是能运行的才对呀,我用的也是他们本身的iPlanet 5.1,应该说不会不兼容吧?有没有高手可以告诉我?

解决方案 »

  1.   

    你的程序试图要往ldap里加入'uid=test,ou=myou,dc=my,dc=cn',
    可是它已经在ldap内存在了。你在程序内把他们的属性值换一下,就ok乐。
      

  2.   

    不,我用console看,并没有这个'uid=test,ou=myou,dc=my,dc=cn'改了后也是不行改成这样
    ...
    String userP = "uid=test1,ou=myou,dc=my,dc=cn";

    Attributes attrs = new BasicAttributes(); 
    attrs.put("objectclass","inetOrgPerson"); // define objectclass of new enry 
    attrs.put("uid","test1"); 
    attrs.put("mail","[email protected]"); 
    attrs.put("telephonenumber","555-555-5555"); DirContext subCtx = ctx.createSubcontext( userP, attrs ); 
    ...也是不行啊
      

  3.   

    attrs.put("cn","youcn"); 
    attrs.put("sn","yousn"); 
      

  4.   

    呀,真的是少了,我昨天是怎么检查的啊...现在行了,谢谢 amandapan(amandapan) :)
      

  5.   

    这年头,连sun上的东西都不能信呀,我就因为太信sun,结果都没怎么检查,结果...