This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Java in General and the fly likes Problem with LDAP query Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Problem with LDAP query" Watch "Problem with LDAP query" New topic
Author

Problem with LDAP query

Dan Grindstaff
Ranch Hand

Joined: Sep 24, 2006
Posts: 135
I have a simple java LDAP client that is throwing an error 'Missing 'equals'; remaining name '''. I have posted the code below. I know it must be something simple I am missing. Please advise.


NOTE: The problem appears tro be on line 34, NamingEnumeration enumeration = context.search("", query, ctrl);
Greg Charles
Bartender

Joined: Oct 01, 2001
Posts: 2550
    
  10

This issue goes quite a bit beyond the beginners' level. Moving to "Java in General".
Hebert Coelho
Ranch Hand

Joined: Jul 14, 2010
Posts: 754

I don't nothing about LDAP, but I was looking at your code and I saw this:
env.put(Context.SECURITY_PRINCIPAL,"CN=bi_lms_bnd,OU=System Account,


By the error message, I think that your problem is that space in System Account.


[uaiHebert.com] [Full WebApplication JSF EJB JPA JAAS with source code to download] One Table Per SubClass [Web/JSF]
Chris Pare
Greenhorn

Joined: Dec 01, 2010
Posts: 5

The problem with your code was only the variables you were submitting...


If your not sure about the LDAP attributes, download the LDAPBrowser from Softerra, it's free and will allow you to walk the LDAP environment like folders on a computer. it also shows all the attributes available to your ID (remember that many attributes are unlocked based on security).

While I am here I would also suggest breaking out the PROVIDER_URL information and setting these values as Strings to keep things easier to find in the future
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32830
    
    4
Welcome to the Ranch Chris Pare
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Problem with LDAP query
 
Similar Threads
About LDAP and JNDI
ApacheDS 1.0.2 LDAP java.net.ConnectException: Connection timed out: connect
LDAP simple authontication Error
[LDAP: error code 32 - No Such Object]; remaining name ''
LDAP sample program