cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
492
Views
0
Helpful
3
Replies

Help for LDAP error code!!!

michael9102
Level 1
Level 1

Hi. Friends. I am just new to JTAPI. Currently, I try to get the controlled phones from a user object. However, I always get an error from the LDAP provider class. I don't know what to do now. Here is my code.

LDAPProvider ldapProv = new LDAPProvider(callmanager, username, password, 8404, "");

I just follow the document of LDAPProvider class. But in the function signature, I am not sure about the fifth parameter rootDn, so I just use "". Does anybody know what it means?? Thank you for your help very much. Have a nice weekend.

public LDAPProvider(java.lang.String ldapServer,

java.lang.String ldapUserId,

java.lang.String ldapPassword,

int ldapPort,

java.lang.String rootDn)

The details of the error is

Problem looking up name:javax.naming.CommunicationException: [LDAP: error code 2

- Protocol error]

3 Replies 3

Sascha Monteiro
Level 6
Level 6

Hi,

String rootDN = "o=cisco.com, ou=users";

String ldapUserId = "cn=Directory Manager, o=cisco.com";

that should do the trick..

Sascha:

Thank you very much for your help. According to your method, it does work for the phone name. However, I got an SAXParseException exception when I queried the phone attributes for each phone. I checked the code and can not find anything wrong. Here is my code and exception output. Any idea about it? I appreciate your help very much.

AXLProvider axlProv;

try

{

axlProv = new AXLProvider(callmanager, ccmAdmin, ccmPS);

}

catch(Exception ex)

{

System.out.println("-1 "+ex.toString());

}

Phone[] phone = null;

try

{

phone = user.getControlledPhones(ldapProv, null);

}

catch(Exception ex)

{

System.out.println("0 ex = "+ex.toString());

}

for(int i =0; i

{

try

{

phone[i].loadAttributes(axlProv, true);

}

catch(Exception ex)

{

System.out.println("1 ex = "+ex.toString());

}

Extension[] tEx = null;

try

{

tEx = phone[i].getExtensions();

}

catch(Exception ex)

{

System.out.println(" 2ex = "+ex.toString());

}

System.out.println("Phone = "+phone[i].getDeviceName());

System.out.println("tEx.length = "+tEx.length);

}

ldapUserId = cn=Directory Manager, o=cisco.com

rootDn = o=cisco.com, ou=users

sucess? true

Hello. user = jtapi

Exception:org.xml.sax.SAXParseException: Missing whitespace before SYSTEM literal URI.

Phone = SEP00036BAACA4D

tEx.length = 0

Exception:org.xml.sax.SAXParseException: Missing whitespace before SYSTEM literal URI.

Phone = SEP00036BAACE55

tEx.length = 0

Exception:org.xml.sax.SAXParseException: Missing whitespace before SYSTEM literal URI.

Phone = SEP000F8F1B5BC4

tEx.length = 0

Sascha:

For my previous post! I already solved the problem. I provide the wrong call manager user name. Thank you very much for your help.