File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
core/src/main/java/org/springframework/ldap/core/support Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 7474 */
7575public abstract class AbstractContextSource implements BaseLdapPathContextSource , InitializingBean {
7676
77- private static final Class <com .sun .jndi .ldap .LdapCtxFactory > DEFAULT_CONTEXT_FACTORY
78- = com .sun .jndi .ldap .LdapCtxFactory .class ;
77+ private static final String DEFAULT_CONTEXT_FACTORY = "com.sun.jndi.ldap.LdapCtxFactory" ;
7978
8079 private static final Class <DefaultDirObjectFactory > DEFAULT_DIR_OBJECT_FACTORY = DefaultDirObjectFactory .class ;
8180 private static final boolean DONT_DISABLE_POOLING = false ;
@@ -84,7 +83,7 @@ public abstract class AbstractContextSource implements BaseLdapPathContextSource
8483
8584 private Class <?> dirObjectFactory = DEFAULT_DIR_OBJECT_FACTORY ;
8685
87- private Class <?> contextFactory = DEFAULT_CONTEXT_FACTORY ;
86+ private Class <?> contextFactory ;
8887
8988 private LdapName base = LdapUtils .emptyLdapName ();
9089
@@ -439,7 +438,7 @@ private Hashtable<String, Object> setupAnonymousEnv() {
439438
440439 Hashtable <String , Object > env = new Hashtable <String , Object >(baseEnv );
441440
442- env .put (Context .INITIAL_CONTEXT_FACTORY , contextFactory .getName ());
441+ env .put (Context .INITIAL_CONTEXT_FACTORY , contextFactory != null ? contextFactory .getName () : DEFAULT_CONTEXT_FACTORY );
443442 env .put (Context .PROVIDER_URL , assembleProviderUrlString (urls ));
444443
445444 if (dirObjectFactory != null ) {
You can’t perform that action at this time.
0 commit comments