directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Karasulu (JIRA)" <j...@apache.org>
Subject [jira] Closed: (DIRSERVER-1090) LdapConfigurationException when trying to connect with "none" security level
Date Tue, 08 Jul 2008 03:44:32 GMT

     [ https://issues.apache.org/jira/browse/DIRSERVER-1090?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Alex Karasulu closed DIRSERVER-1090.
------------------------------------

       Resolution: Won't Fix
    Fix Version/s:     (was: 1.5.3)

This is a 1.0.2 problem which is no longer relevant to the 1.5.x branch.  Also we plan soon
to discontinue the 1.0.x branch.  All users are expected to move to 1.5.x or higher.  It might
be a good idea to see if the latest 1.5.x release exhibits this problem. If so then this issue
can be reopened for the 1.5.x release.

> LdapConfigurationException when trying to connect with "none" security level
> ----------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1090
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1090
>             Project: Directory ApacheDS
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.0.2
>            Reporter: Maarten Coene
>            Assignee: Alex Karasulu
>
> I'm starting the LDAP server in my Java code. I did allow anonymous access.
> When I try to connect with "none" security level, I receive an error.
> This is a snippet of my code:
> {code:java}
> MutableServerStartupConfiguration configuration = new MutableServerStartupConfiguration();
> MutablePartitionConfiguration partitionConf = new MutablePartitionConfiguration();
> partitionConf.setName("test");
> partitionConf.setSuffix("dc=be");
> // Create the first entry
> Attributes attrs = new BasicAttributes(true);
> Attribute attr = new BasicAttribute("objectClass");
> attr.add("top");
> attr.add("domain");
> attr.add("extensibleObject");
> attrs.put(attr);
> attrs.put("dc", "be");
> partitionConf.setContextEntry(attrs);
> // As we can create more than one partition, we must store
> // each created partition in a Set before initialization
> Set pcfgs = new HashSet();
> pcfgs.add(partitionConf);
> configuration.setContextPartitionConfigurations(pcfgs);
> // find the first available port
> int port = AvailablePortFinder.getNextAvailable(1024);
> File workingDirectory = new File("server-work");
> configuration.setWorkingDirectory(workingDirectory);
> configuration.setLdapPort(port);
> configuration.setShutdownHookEnabled(false);
> configuration.setAllowAnonymousAccess(true);
> // Create the LDAP context
> Hashtable env = new Hashtable(configuration.toJndiEnvironment());
> env.put(Context.SECURITY_AUTHENTICATION, "none");
> env.put(Context.INITIAL_CONTEXT_FACTORY, ServerContextFactory.class.getName());
> env.put(Context.PROVIDER_URL, "");
> InitialLdapContext root = new InitialLdapContext(env, null);
> {code}
> I receive the following exception:
> {code}
> org.apache.directory.shared.ldap.exception.LdapConfigurationException: java.naming.security.principal
cannot be null.
> 	at org.apache.directory.server.core.jndi.LdapJndiProperties.getLdapJndiProperties(LdapJndiProperties.java:204)
> 	at org.apache.directory.server.core.jndi.ServerContext.<init>(ServerContext.java:122)
> 	at org.apache.directory.server.core.jndi.ServerDirContext.<init>(ServerDirContext.java:83)
> 	at org.apache.directory.server.core.jndi.ServerLdapContext.<init>(ServerLdapContext.java:63)
> 	at org.apache.directory.server.core.DefaultDirectoryService.getJndiContext(DefaultDirectoryService.java:171)
> 	at org.apache.directory.server.core.jndi.AbstractContextFactory.getInitialContext(AbstractContextFactory.java:138)
> 	at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
> 	at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
> 	at javax.naming.InitialContext.init(InitialContext.java:223)
> 	at javax.naming.ldap.InitialLdapContext.<init>(InitialLdapContext.java:134)
>                      [...]
> {code}
> I've worked around the problem by adding the following to my environment hashmap before
creating the InitialContext:
> {code:java}
> env.put(PropertyKeys.PARSED_BIND_DN, LdapDN.EMPTY_LDAPDN);
> {code}
> Maarten

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message