Cannot instantiate class: com.sun.jndi.ldap.LdapCtxFactory 4.7.10

Just noticed something that doesn’t work after upgrading to 4.7.x.

The code:

env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
ctx = new InitialLdapContext(env, null);

The exception:

java.lang.Exception: Cannot instantiate class: com.sun.jndi.ldap.LdapCtxFactory
...
...
Caused by: javax.naming.NoInitialContextException: Cannot instantiate class: com.sun.jndi.ldap.LdapCtxFactory
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:663) ~[na:1.7.0_67]
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:250) ~[na:1.7.0_67]
at javax.naming.InitialContext.init(InitialContext.java:226) ~[na:1.7.0_67]
at javax.naming.ldap.InitialLdapContext.<init>(InitialLdapContext.java:137) ~[na:1.7.0_67]

Does this have anything to do with newer version of OSGI? works fine in 4.5.x

Hi.

It has something to do with the OSGi boot delegation. But it seems that this parameter is not possible to set in Enonic CMS 4.7. Can you create a support issue on this on our support forum?

BR
Sten Roger