Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

This conversation has been locked due to inactivity. Please create a new post.

SOLVED

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

Avatar

Former Community Member

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.

1 Accepted Solution

Avatar

Correct answer by
Level 1

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);

View solution in original post

1 Reply

Avatar

Correct answer by
Level 1

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);