Class Not found exception class com.sun.jndi.ldap.LdapCtxFactory not found by cqse-httpservice | Community
Skip to main content
October 16, 2015
Solved

Class Not found exception class com.sun.jndi.ldap.LdapCtxFactory not found by cqse-httpservice

Hi,

I am getting this error when i am running a code. I have set the parameters as

 

 Hashtable<String, String> env = new Hashtable<String, String>();
        env.put(Context.INITIAL_CONTEXT_FACTORY, 
                "com.sun.jndi.ldap.LdapCtxFactory");
        env.put(Context.PROVIDER_URL, ldapURL);
        env.put(Context.SECURITY_AUTHENTICATION, "simple");
        env.put(Context.SECURITY_PRINCIPAL, adminName);
        env.put(Context.SECURITY_PROTOCOL, "ssl");
        env.put(Context.SECURITY_CREDENTIALS, adminPassword); 

and i am initializing the factory like this LdapContext ctx = new InitialLdapContext(env,null);

I don't have any references to httpservice but seems like CQ is doing something internally . Can any body give me a clue. I have got the jndi jar in my bundle under export-package.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
avinashTanwarAccepted solution
New Participant
October 16, 2015

can you try with initial context if you want to bind anything with jndi in below way

 

InitialContext initial = new InitialContext(env);
                    initial.bind(dataStoreName, ds);

1 reply

avinashTanwarAccepted solution
New Participant
October 16, 2015

can you try with initial context if you want to bind anything with jndi in below way

 

InitialContext initial = new InitialContext(env);
                    initial.bind(dataStoreName, ds);

Translate