You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by "Benjamin, Roy" <rb...@ebay.com> on 2010/08/06 23:31:40 UTC
Embedded sample question
Hi,
When I run ApacheDS embedded it has a root object: Root DSE(3)
Is this object a 'dc' ?
if so, when really is its name, dc=Root or dc=Root DSE, or dc=Root DSE(3)
Is it possible to change this and or create another dc using the API ?
Thanks
Roy
RE: Embedded sample question
Posted by "Benjamin, Roy" <rb...@ebay.com>.
Thank You Kiran!
I think I'm 'on a run' now.
Roy
-----Original Message-----
From: ayyagarikiran@gmail.com [mailto:ayyagarikiran@gmail.com] On Behalf Of Kiran Ayyagari
Sent: Saturday, August 07, 2010 1:56 AM
To: Apache Directory Developers List
Subject: Re: Embedded sample question
hi Roy,
On Sat, Aug 7, 2010 at 4:26 AM, Benjamin, Roy <rb...@ebay.com> wrote:
> HI,
>
>
>
> What I really need to do is to create a dc.
>
>
>
> I have tried:
>
>
>
> File pd = new File("C:\\doit");
>
> pd.mkdirs();
>
> JdbmPartition partition = null;
>
> try {
>
> JdbmPartitionFactory f = new JdbmPartitionFactory();
>
> partition = f.createPartition("sevenseas",
> "o=sevenseas", 500, pd);
>
> //partition.initialize();
>
> directoryService.addPartition(partition);
>
> } catch (Exception e) {
>
> e.printStackTrace();
>
> }
>
>
>
> directoryService.startup();
>
> ldapServer.start();
>
>
>
> try {
>
> // create the context entry
>
> Entry entry = new DefaultEntry(new
> DN("o=sevenseas"));
here you need to pass the schema manager while creating the entry
(this is required cause inside
the server every Attribute should be schema-aware)
so the above statement should be like
Entry entry = new DefaultEntry( directoryService.getSchemaManager(),
new DN("o=sevenseas"));
>
> entry.put("objectClass", "top",
> "organizationalUnit", "extensibleObject");
>
> entry.put("o", "sevenseas");
another mandatory attribute "ou" needs to added to the entry
entry.put("ou", "sevenseas org unit");
>
>
>
> // add the context entry
>
> AddOperationContext adOpContext = new
> AddOperationContext(directoryService.getAdminSession(), entry);
>
>
> directoryService.getOperationManager().add(adOpContext);
>
>
> //directoryService.getPartitionNexus().addContextPartition(partition);
a simple way to do the same without creating a operation context object is
directoryService.getAdminSession().add( entry );
btw, please post these questions to user ML, would be helpful for
others users if they are facing
similar issues
Kiran Ayyagari
>
> } catch (Exception e) {
>
> e.printStackTrace();
>
> }
>
>
>
>
>
> which gave me:
>
>
>
> schema partition directory exists, skipping schema extraction
>
> [15:54:06] WARN [org.apache.directory.server.core.DefaultDirectoryService] -
> You didn't change the admin password of directory service instance 'null'.
> Please update the admin password as soon as possible to prevent a possible
> security breach.
>
> [15:54:06] WARN
> [org.apache.directory.server.core.referral.ReferralInterceptor] - could not
> find objectClass attribute in entry: Entry
>
> dn[n]: o=sevenseas
>
> objectClass: top
>
> objectClass: organizationalUnit
>
> objectClass: extensibleObject
>
> o: sevenseas
>
>
>
> [15:54:06] ERROR [org.apache.directory.server.core.schema.SchemaInterceptor]
> - ERR_60 Entry o=sevenseas does not contain a STRUCTURAL ObjectClass
>
> org.apache.directory.shared.ldap.exception.LdapSchemaViolationException:
> ERR_60 Entry o=sevenseas does not contain a STRUCTURAL ObjectClass
>
> at
> org.apache.directory.server.core.schema.SchemaInterceptor.assertObjectClasses(SchemaInterceptor.java:1688)
>
> at
> org.apache.directory.server.core.schema.SchemaInterceptor.check(SchemaInterceptor.java:1416)
>
> at
> org.apache.directory.server.core.schema.SchemaInterceptor.add(SchemaInterceptor.java:1507)
>
> at
> org.apache.directory.server.core.interceptor.InterceptorChain$Element$1.add(InterceptorChain.java:1020)
>
> at
> org.apache.directory.server.core.operational.OperationalAttributeInterceptor.add(OperationalAttributeInterceptor.java:236)
>
> at
> org.apache.directory.server.core.interceptor.InterceptorChain$Element$1.add(InterceptorChain.java:1020)
>
> at
> org.apache.directory.server.core.changelog.ChangeLogInterceptor.add(ChangeLogInterceptor.java:105)
>
> at
> org.apache.directory.server.core.interceptor.InterceptorChain$Element$1.add(InterceptorChain.java:1020)
>
> at
> org.apache.directory.server.core.exception.ExceptionInterceptor.add(ExceptionInterceptor.java:157)
>
> at
> org.apache.directory.server.core.interceptor.InterceptorChain$Element$1.add(InterceptorChain.java:1020)
>
> at
> org.apache.directory.server.core.admin.AdministrativePointInterceptor.add(AdministrativePointInterceptor.java:339)
>
> at
> org.apache.directory.server.core.interceptor.InterceptorChain$Element$1.add(InterceptorChain.java:1020)
>
> at
> org.apache.directory.server.core.interceptor.BaseInterceptor.add(BaseInterceptor.java:128)
>
> at
> org.apache.directory.server.core.interceptor.InterceptorChain$Element$1.add(InterceptorChain.java:1020)
>
> at
> org.apache.directory.server.core.authz.AciAuthorizationInterceptor.add(AciAuthorizationInterceptor.java:420)
>
> at
> org.apache.directory.server.core.interceptor.InterceptorChain$Element$1.add(InterceptorChain.java:1020)
>
> at
> org.apache.directory.server.core.referral.ReferralInterceptor.add(ReferralInterceptor.java:247)
>
> at
> org.apache.directory.server.core.interceptor.InterceptorChain$Element$1.add(InterceptorChain.java:1020)
>
> at
> org.apache.directory.server.core.authn.AuthenticationInterceptor.add(AuthenticationInterceptor.java:314)
>
> at
> org.apache.directory.server.core.interceptor.InterceptorChain$Element$1.add(InterceptorChain.java:1020)
>
> at
> org.apache.directory.server.core.normalization.NormalizationInterceptor.add(NormalizationInterceptor.java:118)
>
> at
> org.apache.directory.server.core.interceptor.InterceptorChain.add(InterceptorChain.java:650)
>
> at
> org.apache.directory.server.core.DefaultOperationManager.add(DefaultOperationManager.java:265)
>
> at
> org.example.StartStopListener2.contextInitialized(StartStopListener2.java:108)
>
> at
> org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3795)
>
> at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:4252)
>
> at
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
>
> at
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
>
> at
> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
>
>
>
> From: Benjamin, Roy [mailto:rbenjamin@ebay.com]
> Sent: Friday, August 06, 2010 2:32 PM
> To: Apache Directory Developers List
> Subject: Embedded sample question
>
>
>
> Hi,
>
>
>
> When I run ApacheDS embedded it has a root object: Root DSE(3)
>
>
>
> Is this object a 'dc' ?
>
>
>
> if so, when really is its name, dc=Root or dc=Root DSE, or dc=Root
> DSE(3)
>
>
>
>
>
> Is it possible to change this and or create another dc using the API ?
>
>
>
> Thanks
>
>
>
> Roy
Re: Embedded sample question
Posted by Kiran Ayyagari <ka...@apache.org>.
hi Roy,
On Sat, Aug 7, 2010 at 4:26 AM, Benjamin, Roy <rb...@ebay.com> wrote:
> HI,
>
>
>
> What I really need to do is to create a dc.
>
>
>
> I have tried:
>
>
>
> File pd = new File("C:\\doit");
>
> pd.mkdirs();
>
> JdbmPartition partition = null;
>
> try {
>
> JdbmPartitionFactory f = new JdbmPartitionFactory();
>
> partition = f.createPartition("sevenseas",
> "o=sevenseas", 500, pd);
>
> //partition.initialize();
>
> directoryService.addPartition(partition);
>
> } catch (Exception e) {
>
> e.printStackTrace();
>
> }
>
>
>
> directoryService.startup();
>
> ldapServer.start();
>
>
>
> try {
>
> // create the context entry
>
> Entry entry = new DefaultEntry(new
> DN("o=sevenseas"));
here you need to pass the schema manager while creating the entry
(this is required cause inside
the server every Attribute should be schema-aware)
so the above statement should be like
Entry entry = new DefaultEntry( directoryService.getSchemaManager(),
new DN("o=sevenseas"));
>
> entry.put("objectClass", "top",
> "organizationalUnit", "extensibleObject");
>
> entry.put("o", "sevenseas");
another mandatory attribute "ou" needs to added to the entry
entry.put("ou", "sevenseas org unit");
>
>
>
> // add the context entry
>
> AddOperationContext adOpContext = new
> AddOperationContext(directoryService.getAdminSession(), entry);
>
>
> directoryService.getOperationManager().add(adOpContext);
>
>
> //directoryService.getPartitionNexus().addContextPartition(partition);
a simple way to do the same without creating a operation context object is
directoryService.getAdminSession().add( entry );
btw, please post these questions to user ML, would be helpful for
others users if they are facing
similar issues
Kiran Ayyagari
>
> } catch (Exception e) {
>
> e.printStackTrace();
>
> }
>
>
>
>
>
> which gave me:
>
>
>
> schema partition directory exists, skipping schema extraction
>
> [15:54:06] WARN [org.apache.directory.server.core.DefaultDirectoryService] -
> You didn't change the admin password of directory service instance 'null'.
> Please update the admin password as soon as possible to prevent a possible
> security breach.
>
> [15:54:06] WARN
> [org.apache.directory.server.core.referral.ReferralInterceptor] - could not
> find objectClass attribute in entry: Entry
>
> dn[n]: o=sevenseas
>
> objectClass: top
>
> objectClass: organizationalUnit
>
> objectClass: extensibleObject
>
> o: sevenseas
>
>
>
> [15:54:06] ERROR [org.apache.directory.server.core.schema.SchemaInterceptor]
> - ERR_60 Entry o=sevenseas does not contain a STRUCTURAL ObjectClass
>
> org.apache.directory.shared.ldap.exception.LdapSchemaViolationException:
> ERR_60 Entry o=sevenseas does not contain a STRUCTURAL ObjectClass
>
> at
> org.apache.directory.server.core.schema.SchemaInterceptor.assertObjectClasses(SchemaInterceptor.java:1688)
>
> at
> org.apache.directory.server.core.schema.SchemaInterceptor.check(SchemaInterceptor.java:1416)
>
> at
> org.apache.directory.server.core.schema.SchemaInterceptor.add(SchemaInterceptor.java:1507)
>
> at
> org.apache.directory.server.core.interceptor.InterceptorChain$Element$1.add(InterceptorChain.java:1020)
>
> at
> org.apache.directory.server.core.operational.OperationalAttributeInterceptor.add(OperationalAttributeInterceptor.java:236)
>
> at
> org.apache.directory.server.core.interceptor.InterceptorChain$Element$1.add(InterceptorChain.java:1020)
>
> at
> org.apache.directory.server.core.changelog.ChangeLogInterceptor.add(ChangeLogInterceptor.java:105)
>
> at
> org.apache.directory.server.core.interceptor.InterceptorChain$Element$1.add(InterceptorChain.java:1020)
>
> at
> org.apache.directory.server.core.exception.ExceptionInterceptor.add(ExceptionInterceptor.java:157)
>
> at
> org.apache.directory.server.core.interceptor.InterceptorChain$Element$1.add(InterceptorChain.java:1020)
>
> at
> org.apache.directory.server.core.admin.AdministrativePointInterceptor.add(AdministrativePointInterceptor.java:339)
>
> at
> org.apache.directory.server.core.interceptor.InterceptorChain$Element$1.add(InterceptorChain.java:1020)
>
> at
> org.apache.directory.server.core.interceptor.BaseInterceptor.add(BaseInterceptor.java:128)
>
> at
> org.apache.directory.server.core.interceptor.InterceptorChain$Element$1.add(InterceptorChain.java:1020)
>
> at
> org.apache.directory.server.core.authz.AciAuthorizationInterceptor.add(AciAuthorizationInterceptor.java:420)
>
> at
> org.apache.directory.server.core.interceptor.InterceptorChain$Element$1.add(InterceptorChain.java:1020)
>
> at
> org.apache.directory.server.core.referral.ReferralInterceptor.add(ReferralInterceptor.java:247)
>
> at
> org.apache.directory.server.core.interceptor.InterceptorChain$Element$1.add(InterceptorChain.java:1020)
>
> at
> org.apache.directory.server.core.authn.AuthenticationInterceptor.add(AuthenticationInterceptor.java:314)
>
> at
> org.apache.directory.server.core.interceptor.InterceptorChain$Element$1.add(InterceptorChain.java:1020)
>
> at
> org.apache.directory.server.core.normalization.NormalizationInterceptor.add(NormalizationInterceptor.java:118)
>
> at
> org.apache.directory.server.core.interceptor.InterceptorChain.add(InterceptorChain.java:650)
>
> at
> org.apache.directory.server.core.DefaultOperationManager.add(DefaultOperationManager.java:265)
>
> at
> org.example.StartStopListener2.contextInitialized(StartStopListener2.java:108)
>
> at
> org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3795)
>
> at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:4252)
>
> at
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
>
> at
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
>
> at
> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
>
>
>
> From: Benjamin, Roy [mailto:rbenjamin@ebay.com]
> Sent: Friday, August 06, 2010 2:32 PM
> To: Apache Directory Developers List
> Subject: Embedded sample question
>
>
>
> Hi,
>
>
>
> When I run ApacheDS embedded it has a root object: Root DSE(3)
>
>
>
> Is this object a 'dc' ?
>
>
>
> if so, when really is its name, dc=Root or dc=Root DSE, or dc=Root
> DSE(3)
>
>
>
>
>
> Is it possible to change this and or create another dc using the API ?
>
>
>
> Thanks
>
>
>
> Roy
RE: Embedded sample question
Posted by "Benjamin, Roy" <rb...@ebay.com>.
HI,
What I really need to do is to create a dc.
I have tried:
File pd = new File("C:\\doit");
pd.mkdirs();
JdbmPartition partition = null;
try {
JdbmPartitionFactory f = new JdbmPartitionFactory();
partition = f.createPartition("sevenseas", "o=sevenseas", 500, pd);
//partition.initialize();
directoryService.addPartition(partition);
} catch (Exception e) {
e.printStackTrace();
}
directoryService.startup();
ldapServer.start();
try {
// create the context entry
Entry entry = new DefaultEntry(new DN("o=sevenseas"));
entry.put("objectClass", "top", "organizationalUnit", "extensibleObject");
entry.put("o", "sevenseas");
// add the context entry
AddOperationContext adOpContext = new AddOperationContext(directoryService.getAdminSession(), entry);
directoryService.getOperationManager().add(adOpContext);
//directoryService.getPartitionNexus().addContextPartition(partition);
} catch (Exception e) {
e.printStackTrace();
}
which gave me:
schema partition directory exists, skipping schema extraction
[15:54:06] WARN [org.apache.directory.server.core.DefaultDirectoryService] - You didn't change the admin password of directory service instance 'null'. Please update the admin password as soon as possible to prevent a possible security breach.
[15:54:06] WARN [org.apache.directory.server.core.referral.ReferralInterceptor] - could not find objectClass attribute in entry: Entry
dn[n]: o=sevenseas
objectClass: top
objectClass: organizationalUnit
objectClass: extensibleObject
o: sevenseas
[15:54:06] ERROR [org.apache.directory.server.core.schema.SchemaInterceptor] - ERR_60 Entry o=sevenseas does not contain a STRUCTURAL ObjectClass
org.apache.directory.shared.ldap.exception.LdapSchemaViolationException: ERR_60 Entry o=sevenseas does not contain a STRUCTURAL ObjectClass
at org.apache.directory.server.core.schema.SchemaInterceptor.assertObjectClasses(SchemaInterceptor.java:1688)
at org.apache.directory.server.core.schema.SchemaInterceptor.check(SchemaInterceptor.java:1416)
at org.apache.directory.server.core.schema.SchemaInterceptor.add(SchemaInterceptor.java:1507)
at org.apache.directory.server.core.interceptor.InterceptorChain$Element$1.add(InterceptorChain.java:1020)
at org.apache.directory.server.core.operational.OperationalAttributeInterceptor.add(OperationalAttributeInterceptor.java:236)
at org.apache.directory.server.core.interceptor.InterceptorChain$Element$1.add(InterceptorChain.java:1020)
at org.apache.directory.server.core.changelog.ChangeLogInterceptor.add(ChangeLogInterceptor.java:105)
at org.apache.directory.server.core.interceptor.InterceptorChain$Element$1.add(InterceptorChain.java:1020)
at org.apache.directory.server.core.exception.ExceptionInterceptor.add(ExceptionInterceptor.java:157)
at org.apache.directory.server.core.interceptor.InterceptorChain$Element$1.add(InterceptorChain.java:1020)
at org.apache.directory.server.core.admin.AdministrativePointInterceptor.add(AdministrativePointInterceptor.java:339)
at org.apache.directory.server.core.interceptor.InterceptorChain$Element$1.add(InterceptorChain.java:1020)
at org.apache.directory.server.core.interceptor.BaseInterceptor.add(BaseInterceptor.java:128)
at org.apache.directory.server.core.interceptor.InterceptorChain$Element$1.add(InterceptorChain.java:1020)
at org.apache.directory.server.core.authz.AciAuthorizationInterceptor.add(AciAuthorizationInterceptor.java:420)
at org.apache.directory.server.core.interceptor.InterceptorChain$Element$1.add(InterceptorChain.java:1020)
at org.apache.directory.server.core.referral.ReferralInterceptor.add(ReferralInterceptor.java:247)
at org.apache.directory.server.core.interceptor.InterceptorChain$Element$1.add(InterceptorChain.java:1020)
at org.apache.directory.server.core.authn.AuthenticationInterceptor.add(AuthenticationInterceptor.java:314)
at org.apache.directory.server.core.interceptor.InterceptorChain$Element$1.add(InterceptorChain.java:1020)
at org.apache.directory.server.core.normalization.NormalizationInterceptor.add(NormalizationInterceptor.java:118)
at org.apache.directory.server.core.interceptor.InterceptorChain.add(InterceptorChain.java:650)
at org.apache.directory.server.core.DefaultOperationManager.add(DefaultOperationManager.java:265)
at org.example.StartStopListener2.contextInitialized(StartStopListener2.java:108)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3795)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4252)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
From: Benjamin, Roy [mailto:rbenjamin@ebay.com]
Sent: Friday, August 06, 2010 2:32 PM
To: Apache Directory Developers List
Subject: Embedded sample question
Hi,
When I run ApacheDS embedded it has a root object: Root DSE(3)
Is this object a 'dc' ?
if so, when really is its name, dc=Root or dc=Root DSE, or dc=Root DSE(3)
Is it possible to change this and or create another dc using the API ?
Thanks
Roy