You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by "Maarten Coene (JIRA)" <ji...@apache.org> on 2007/10/18 17:19:50 UTC

[jira] Created: (DIRSERVER-1090) LdapConfigurationException when trying to connect with "none" security level

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


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.


[jira] Updated: (DIRSERVER-1090) LdapConfigurationException when trying to connect with "none" security level

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRSERVER-1090?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Lecharny updated DIRSERVER-1090:
-----------------------------------------

    Fix Version/s: 1.5.3

No time for 1.5.2...

Postponed to 1.5.3

> 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
>             Fix For: 1.5.3
>
>
> 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.


[jira] Commented: (DIRSERVER-1090) LdapConfigurationException when trying to connect with "none" security level

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRSERVER-1090?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12578371#action_12578371 ] 

Emmanuel Lecharny commented on DIRSERVER-1090:
----------------------------------------------

Should be investigated in 1.5.1 base to ee if we have the same issue.

> 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
>
> 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.


[jira] Closed: (DIRSERVER-1090) LdapConfigurationException when trying to connect with "none" security level

Posted by "Alex Karasulu (JIRA)" <ji...@apache.org>.
     [ 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.


[jira] Assigned: (DIRSERVER-1090) LdapConfigurationException when trying to connect with "none" security level

Posted by "Alex Karasulu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRSERVER-1090?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alex Karasulu reassigned DIRSERVER-1090:
----------------------------------------

    Assignee: Alex Karasulu

> 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
>             Fix For: 1.5.3
>
>
> 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.