This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Security and the fly likes failed to retrieve attributes from weblogic embeded ldap Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » Security
Bookmark "failed to retrieve attributes from weblogic embeded ldap" Watch "failed to retrieve attributes from weblogic embeded ldap" New topic
Author

failed to retrieve attributes from weblogic embeded ldap

Robert Strong
Ranch Hand

Joined: Sep 10, 2002
Posts: 84
hi, I'm using JNDI to retrieve attributes from weblogic8.1 embeded ldap.
my code is like below:

String userDN = "uid=bigrez,ou=people,ou=myrealm,dc=bigrezdomain";
DirContext dirCtx = null;
Hashtable ht = new Hashtable();
ht.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
ht.put(Context.PROVIDER_URL, "ldap://tiger:7001");
ht.put(Context.SECURITY_PRINCIPAL, userDN);
ht.put(Context.SECURITY_CREDENTIALS, "xxxx");
try{
dirCtx = new InitialDirContext(ht);
Attributes answer = dirCtx.getAttributes("uid=adminbigrez,ou=people,ou=myrealm,dc=bigrezdomain");
NamingEnumeration attrEnum = answer.getAll();
while(attrEnum.hasMore()){
Attribute attr = (Attribute)attrEnum.next();
String id = attr.getID();

}

but cannot retrieve any attributes from that entry, attrEnum always has no elements, while I'm pretty sure the DN="uid=adminbigrez,ou=people,ou=myrealm,dc=bigrezdomain" is correct.

could any one here help me out?
 
 
subject: failed to retrieve attributes from weblogic embeded ldap