07-26-2008 07:53 AM
JDE 4.5.0
Simulator: 8300, 4.5.0.44
MDS-CS is running and seems to be working (external web pages are accessible)
I am trying to query a standard plain ol' nothing special anonymous login LDAP server using net.rim.device.api.ldap.LDAPQuery, but I keep ending up with net.rim.device.api.ldap.LDAPQuery.LDAP_ERROR_
The documentation doesn't give any specifics about what the error message actually means or where it comes from.
The host name and port are correct, I can access the LDAP service through several other applications (on my desktop) just fine. From what I can tell, the simulator is not even attempting to actually connect to the LDAP server. (There doesn't seem to be anything about it in the MDS logs and application.handler.ldap.logging is set to 'true' in the rimpublic.property configuration file.
Anyone have any ideas?
07-26-2008 08:58 AM
07-27-2008 10:38 AM
LDAPQuery query = new LDAPQuery();
query.setHost("ldap.itd.umich.edu",389,"ou=Securit
y,dc=umich,dc=edu"); query.setAuthType(LDAPQuery.LDAP_AUTH_ANONYMOUS);
query.setScope(LDAPQuery.LDAP_SCOPE_SUB);
query.addAttribute("cn");query.start();
Enumeration enum = query.getResults();
if (query.getErrorCode() != LDAPQuery.LDAP_SUCCESS) {
it is always happening that query.getErrorCode() returns net.rim.device.api.ldap.LDAPQuery.LDAP_ERROR_SERVI
07-28-2008 01:05 PM
Please enter your LDAP information in the rimpublic.property file for the MDS Simulator. It is located in the (install directory)\MDS\config directory.
Does the same query execute in your environment using the Microsoft LDP Support Tool Utility?
07-28-2008 04:47 PM
ok I changed that to:
[LDAP HANDLER]
application.handler.ldap.DEFAULT_SERVER = ldap.itd.umich.edu
application.handler.ldap.DEFAULT_PORT = 389
application.handler.ldap.DEFAULT_QUERY = ou=Security,dc=umich,dc=edu
application.handler.ldap.DEFAULT_LIMIT = 20
application.handler.ldap.COMPRESSION = false (note: i tried this set to true also)
application.handler.ldap.logging = true
then restarted the MDS simulator, same problem. On a hunch, I changed the query up a bit to:
query.setHost("ldap.itd.umich.edu",389,"ou=Securit
query.setAuthType(LDAPQuery.LDAP_AUTH_ANONYMOUS);
query.setScope(LDAPQuery.LDAP_SCOPE_ONE);
query.addAttribute("cn");
query.addFilter("cn=*");
but still the same problem. I can query just fine from the MS LDP Support Tool.
Thanks for helping out with this :-)
07-28-2008 04:51 PM
07-29-2008 04:51 PM - edited 07-29-2008 04:54 PM
Maybe I'm just overlooking something... I'm normally a C++ developer rather than a J2ME developer so maybe there is some stupid mistake, here is a very small program I made just to test for this particular issue, am I just missing something?
package net.test.ldap;
import java.io.*;
import java.util.*;
import net.rim.device.api.ui.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.*;
import net.rim.device.api.system.*;
import net.rim.device.api.util.*;
import net.rim.device.api.ldap.*;
public final class RIMLDAPTest extends UiApplication
{
public static void main(String[] args)
{
new RIMLDAPTest().enterEventDispatcher();
}
public RIMLDAPTest()
{
LDAPQuery query = new LDAPQuery();
try {
query.setHost("ldap.itd.umich.edu",389,"ou=Securit
y,dc=umich,dc=edu"); query.setAuthType(LDAPQuery.LDAP_AUTH_ANONYMOUS);
query.setScope(LDAPQuery.LDAP_SCOPE_ONE);
query.addAttribute("cn");
query.addFilter("cn=Postmaster");
query.start();
Enumeration enum = query.getResults();
if (query.getErrorCode() == LDAPQuery.LDAP_ERROR_SERVICE_UNAVAILABLE_EXCEPTION
) System.out.println(":-(");
else
System.out.println(":-D");
}
catch(Exception e) {
System.out.println(e.getMessage());
System.exit(1);
}
}
}
09-13-2008 04:09 PM
Any solution to this issue? I am receiving the same error.
Editing rimpublic.property was not helpful and there is no evidence in the MDS simulator that the LDAP request is even made!
09-14-2008 12:43 PM
09-14-2008 12:48 PM