• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

LDAP Sorting

 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can some one help me with sorting? I have the following code:
...
DirContext ctx = new InitialDirContext(env);// get a reference to a directory context

// Create critical Sort that sorts based on givenName
Control[] ctxCtls = new Control[]{
new SortControl(
new String[]{"givenName"}, Control.CRITICAL)
};

// Sets context request controls; effect until
ctx.setRequestControls(ctxCtls);

// begin search
// specify the scope of the search
SearchControls constraints = new SearchControls();
constraints.setSearchScope(SearchControls.SUBTREE_SCOPE);
...
And I get the following error message:

Generated servlet error:
[javac] Since fork is true, ignoring compiler setting.
[javac] Compiling 1 source file
[javac] Since fork is true, ignoring compiler setting.
[javac] D:\Program Files\Apache Group\jakarta-tomcat-5\work\Catalina\localhost\sweetheart\org\apache\jsp\phone_005fbook_jsp.java:203: cannot resolve symbol
[javac] symbol : method setRequestControls (javax.naming.ldap.Control[])
[javac] location: interface javax.naming.directory.DirContext
[javac] ctx.setRequestControls(ctxCtls);
[javac] ^
[javac] 1 error

Any clues?
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have problem on ldap sorting too. But it's a little bit different. It can be compiled successfully. But during run time,
error code 12 occurred:
critical extension is unavailable
Does it mean:
1. my ldap server do not support sorting? (but it should because i can do sorting by using command ldapsearch)
2. my package doesn't support sorting? I'm using javax.naming.*
javax.naming.directory.*
javax.naming.ldap.*
com.sun.jndi.ldap.*
com.sun.jndi.ldap.ctl.*
Thanks a lot!
 
Warning! Way too comfortable! Do not sit! Try reading this tiny ad instead:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic