Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

New Developer
Posts: 1
Registered: ‎09-10-2009
My Device: Not Specified

LDAP not working with MDS simulator ?

[ Edited ]

Since this hasn't been discussed here in a while, I thought I'd give it a try.

I'm trying to get an LDAP connection working with the MDS simulator. I've searched around the various BB forums and haven't seen any solutions other then it just might be broken, period.

My setup :

- Eclipse 3.4.1 with BB JDE plugin
- BB JDE component packages,,,
- with the corresponding MDS sim's
- BlackBerry Email & MDS Services Simulators 4.1.2
- BB JDE 4.7.0
- various device simulators

I set up the MDS config files with the LDAP connection information per the config file info :



# ou = organizational unit
# o = organization name
application.handler.ldap.DEFAULT_SERVER = dhobbs-wnt
application.handler.ldap.DEFAULT_PORT = 389
application.handler.ldap.DEFAULT_QUERY = ou=people, o=rim.net
application.handler.ldap.DEFAULT_LIMIT = 20
application.handler.ldap.COMPRESSION = true
application.handler.ldap.logging = false


Names/values changed to protect the innocent. I wrote a simple standalone Java program to test my company's LDAP connection and it works fine. I put those same setting into the MDS config file.

I tried this example BB Java program from the API docs :


package com.ldap.test;

import java.io.*;

import java.util.*;
import net.rim.device.api.ui.*;
import net.rim.device.api.ldap.*;

public class LDAPTest extends UiApplication
public static void main( String[] args )
new LDAPTest ().enterEventDispatcher();

public LDAPTest ()
// create query object
LDAPQuery query = new LDAPQuery();

// host to contact; port; base query to use
query.setHost("ldap.blahblah.com",389,"o=blahblah. com,c=US");

query.setAuthType( LDAPQuery.LDAP_AUTH_ANONYMOUS );

query.setAuthType( LDAPQuery.LDAP_AUTH_SIMPLE );

// scope of query
// The scope determines what entries are returned from a query.
// * A "base"-level scope ("LDAPQuery.LDAP_SCOPE_BASE") returns the
// entry addressed by the base query.
// * A "one"-level scope ("LDAPQuery.LDAP_SCOPE_ONE") returns all
// the entries one level below the entry addressed by the base query.
// * A "sub"-level scope ("LDAPQuery.LDAP_SCOPE_SUB") returns all
// the entries below the entry addressed by the base query.

query.setScope( LDAPQuery.LDAP_SCOPE_BASE );

// attributes to be return from the query
query.addAttribute( "cn" );

// filter to apply to the results

// start query

// results of query are stored in an enumeration type var
Enumeration enum1 = query.getResults();

System.out.println("*** FAILED ***\n" );
System.out.println("\n*** SUCCESS ***\n" );
catch(Exception e)


I've tried this with various MDS simulators and device simulators I have installed and trying out various parameters. I've turned on all the MDS logging settings I can find. Yes, simulator proxy settings work, I can browse my company's internal & external web just fine.

Yes, same negative results with Eclipse and with the BB JDE.

I'm getting NOTHING back from the MDS sim, no indication that the LDAP query is working other then

query.getErrorCode = 127


If I switch the authorization type :


query.setAuthType( LDAPQuery.LDAP_AUTH_SIMPLE )


The BB sim does ask for the user/password, but still nothing.

Has anyone had any success with LDAP & MDS simulator ?


Message Edited by mlucek on 09-21-2009 07:52 PM