Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

failed to retrieve attributes from weblogic embeded ldap

 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Dinner will be steamed monkey heads with a side of tiny ads.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic