You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Spark Shen <sm...@gmail.com> on 2007/11/21 07:38:28 UTC

[ApacheDS] [Partition] Adding your own partition resp. suffix

I could not add a new partition when using 1.5.1 (downloaded from *
http://apache.stu.edu.tw/directory/apacheds/unstable/1.5/1.5.1*).

I followed steps in:
http://directory.apache.org/apacheds/1.5/144-adding-your-own-partition-resp-suffix.html#1.4.4Addingyourownpartitionresp.suffix-Definingapartition
and added a partition definition:

  <bean id="sevenSeasPartitionConfiguration" class="
org.apache.directory.server.core.partition.impl.btree.MutableBTreePartitionConfiguration
">
    <property name="id" value="The seven seas" />
    <property name="cacheSize" value="100" />
    <property name="suffix" value="o=sevenSeas" />
    <property name="partitionClassName"
      value="
org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition" />

    <!-- the optimizer is enabled by default but may not always be what
-->
    <!-- you want if your queries are really simple
-->
    <property name="optimizerEnabled" value="true" />

    <!--
      Synchronization on writes does not wait for synch operations
      to flush dirty pages.  Writes persist immediately to disk at
      a cost to performance with increased data integrity.  Otherwise
      the periodic synch operation will flush dirty pages using the
      synchPeriodMillis parameter in the main configuration.
    -->
    <property name="synchOnWrite" value="true" />
    <property name="indexedAttributes">
      <set>
        <bean class="
org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration
">
          <property name="attributeId" value="1.3.6.1.4.1.18060.0.4.1.2.1"
/>
          <property name="cacheSize" value="100" />
        </bean>
        <bean class="
org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration
">
          <property name="attributeId" value="1.3.6.1.4.1.18060.0.4.1.2.2"
/>
          <property name="cacheSize" value="100" />
        </bean>
        <bean class="
org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration
">
          <property name="attributeId" value="1.3.6.1.4.1.18060.0.4.1.2.3"
/>
          <property name="cacheSize" value="100" />
        </bean>
        <bean class="
org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration
">
          <property name="attributeId" value="1.3.6.1.4.1.18060.0.4.1.2.4"
/>
          <property name="cacheSize" value="100" />
        </bean>
        <bean class="
org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration
">
          <property name="attributeId" value="1.3.6.1.4.1.18060.0.4.1.2.5"
/>
          <property name="cacheSize" value="10" />
        </bean>
        <bean class="
org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration
">
          <property name="attributeId" value="1.3.6.1.4.1.18060.0.4.1.2.6"
/>
          <property name="cacheSize" value="10" />
        </bean>
        <bean class="
org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration
">
          <property name="attributeId" value="1.3.6.1.4.1.18060.0.4.1.2.7"
/>
          <property name="cacheSize" value="10" />
        </bean>

        <bean class="
org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration
">
          <property name="attributeId" value="dc" />
          <property name="cacheSize" value="100" />
        </bean>
        <bean class="
org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration
">
          <property name="attributeId" value="ou" />
          <property name="cacheSize" value="100" />
        </bean>
        <bean class="
org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration
">
          <property name="attributeId" value="krb5PrincipalName" />
          <property name="cacheSize" value="100" />
        </bean>
        <bean class="
org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration
">
          <property name="attributeId" value="uid" />
          <property name="cacheSize" value="100" />
        </bean>
        <bean class="
org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration
">
          <property name="attributeId" value="objectClass" />
          <property name="cacheSize" value="100" />
        </bean>
      </set>
    </property>
    <property name="contextEntry">
      <value>
        objectClass: top
        objectClass: domain
        objectClass: extensibleObject
        dc: example
      </value>
    </property>
  </bean>

When I restart the ldap server, I see no partition named o=sevenSeas in
studio, and while importing
apache_ds_tutorial.ldif, I got:
#!ERROR [LDAP: error code 32 - failed to add entry ou=people,o=sevenSeas:
ou=people,o=sevenSeas]

What could be the problem? Did I mis-configured something?

 BTW, how could ldap server be started/stopped from command line? I always
do a install/uninstall instead,
which is a little laborious.

When I type in "apacheds.exe ..\conf\apacheds.conf" I got the following
error msg:
wrapper  | --> Wrapper Started as Console
Unable to get the current logfile size with stat: 文件名、目录名或卷标语法不正确
。 (0x7b)
wrapper  | Launching a JVM...
jvm 1    | java.lang.ExceptionInInitializerError
Unable to get the current logfile size with stat: 文件名、目录名或卷标语法不正确
。 (0x7b)
jvm 1    |      at org.slf4j.impl.Log4jLoggerFactory.getLogger
(Log4jLoggerFactor
y.java:73)
jvm 1    |      at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:103)
jvm 1    |      at org.apache.directory.daemon.Bootstrapper
.<clinit>(Bootstrappe
r.java:57)
jvm 1    | Caused by: java.lang.IllegalArgumentException
jvm 1    |      at sun.net.www.ParseUtil.decode(ParseUtil.java:183)
jvm 1    |      at sun.net.www.protocol.file.Handler.openConnection(
Handler.java
:65)
jvm 1    |      at sun.net.www.protocol.file.Handler.openConnection(
Handler.java
:55)
jvm 1    |      at java.net.URL.openConnection(URL.java:943)
jvm 1    |      at java.net.URL.openStream(URL.java:1007)
jvm 1    |      at org.apache.log4j.PropertyConfigurator.doConfigure
(PropertyCon
figurator.java:433)
jvm 1    |      at
org.apache.log4j.helpers.OptionConverter.selectAndConfigure(O
ptionConverter.java:470)
jvm 1    |      at org.apache.log4j.LogManager.<clinit>(LogManager.java:122)
jvm 1    |      ... 3 more
jvm 1    | Exception in thread "main"
wrapper  | JVM exited while loading the application.
wrapper  | There were 1 failed launches in a row, each lasting less than 300
sec
onds.  Giving up.
wrapper  |   There may be a configuration problem: please check the logs.
wrapper  | <-- Wrapper Stopped

C:\Program Files\Apache Directory Server\bin>apacheds.exe..\instances\default\c
onf\apacheds.conf
wrapper  | --> Wrapper Started as Console
wrapper  | Launching a JVM...
jvm 1    | 找不到 java 类: Main
wrapper  | JVM exited while loading the application.
wrapper  | CTRL-C trapped.  Shutting down.
wrapper  | <-- Wrapper Stopped

Thanks in advance.
-- 
Spark Shen
China Software Development Lab, IBM

Re: [ApacheDS] [Partition] Adding your own partition resp. suffix

Posted by Spark Shen <sm...@gmail.com>.
Thanks, seems my carelessness caused the problem.

2007/11/21, Stefan Zoerner <st...@labeo.de>:
>
> Spark Shen wrote:
> >
> > I followed steps in:
> >
> http://directory.apache.org/apacheds/1.5/144-adding-your-own-partition-resp-suffix.html#1.4.4Addingyourownpartitionresp.suffix-Definingapartition
> > <
> http://directory.apache.org/apacheds/1.5/144-adding-your-own-partition-resp-suffix.html#1.4.4Addingyourownpartitionresp.suffix-Definingapartition
> >
> > and added a partition definition:
> >
> >   <bean id="sevenSeasPartitionConfiguration"
> > class="
> org.apache.directory.server.core.partition.impl.btree.MutableBTreePartitionConfiguration
> ">
> >     <property name="id" value="The seven seas" />
> >     <property name="cacheSize" value="100" />
> >     <property name="suffix" value="o=sevenSeas" />
> >     <property name="partitionClassName"
> >
> > value="
> org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition"
> > />
> >
> >     <property name="contextEntry">
> >       <value>
> >         objectClass: top
> >         objectClass: domain
> >         objectClass: extensibleObject
> >         dc: example
> >       </value>
> >     </property>
> >   </bean>
>
> Check Ersin's hint, and besides that: the value of the contextEntry
> property does not fit with your partition. Try something like this
>
> <property name="contextEntry">
>   <value>
>       objectClass: top
>       objectClass: organization
>       objectClass: extensibleObject
>       o: sevenSeas
>   </value>
> </property>
>
> Greetings from Hamburg,
>     Stefan
>
>


-- 
Spark Shen
China Software Development Lab, IBM

Re: [ApacheDS] [Partition] Adding your own partition resp. suffix

Posted by Stefan Zoerner <st...@labeo.de>.
Spark Shen wrote:
> 
> I followed steps in: 
> http://directory.apache.org/apacheds/1.5/144-adding-your-own-partition-resp-suffix.html#1.4.4Addingyourownpartitionresp.suffix-Definingapartition 
> <http://directory.apache.org/apacheds/1.5/144-adding-your-own-partition-resp-suffix.html#1.4.4Addingyourownpartitionresp.suffix-Definingapartition>
> and added a partition definition:
> 
>   <bean id="sevenSeasPartitionConfiguration" 
> class="org.apache.directory.server.core.partition.impl.btree.MutableBTreePartitionConfiguration">
>     <property name="id" value="The seven seas" />
>     <property name="cacheSize" value="100" />
>     <property name="suffix" value="o=sevenSeas" />
>     <property name="partitionClassName"
>       
> value="org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition" 
> />
> 
>     <property name="contextEntry">
>       <value>
>         objectClass: top
>         objectClass: domain
>         objectClass: extensibleObject
>         dc: example
>       </value>
>     </property>
>   </bean>

Check Ersin's hint, and besides that: the value of the contextEntry
property does not fit with your partition. Try something like this

<property name="contextEntry">
  <value>
      objectClass: top
      objectClass: organization
      objectClass: extensibleObject
      o: sevenSeas
  </value>
</property>

Greetings from Hamburg,
    Stefan


Re: [ApacheDS] [Partition] Adding your own partition resp. suffix

Posted by Ersin Er <er...@gmail.com>.
Hi,

Have you also added the configuration to the configuration list as follows?

<property name="contextPartitionConfigurations">
  <set>
    <ref bean="examplePartitionConfiguration"/>
    <ref bean="sevenSeasPartitionConfiguration"/>
  </set>
</property>



On Nov 21, 2007 8:38 AM, Spark Shen <sm...@gmail.com> wrote:

> I could not add a new partition when using 1.5.1 (downloaded from *
> http://apache.stu.edu.tw/directory/apacheds/unstable/1.5/1.5.1 *).
>
> I followed steps in: http://directory.apache.org/apacheds/1.5/144-adding-your-own-partition-resp-suffix.html#1.4.4Addingyourownpartitionresp.suffix-Definingapartition
>
> and added a partition definition:
>
>   <bean id="sevenSeasPartitionConfiguration" class="
> org.apache.directory.server.core.partition.impl.btree.MutableBTreePartitionConfiguration
> ">
>     <property name="id" value="The seven seas" />
>     <property name="cacheSize" value="100" />
>     <property name="suffix" value="o=sevenSeas" />
>     <property name="partitionClassName"
>       value="
> org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition"
> />
>
>     <!-- the optimizer is enabled by default but may not always be
> what     -->
>     <!-- you want if your queries are really
> simple                         -->
>     <property name="optimizerEnabled" value="true" />
>
>     <!--
>       Synchronization on writes does not wait for synch operations
>       to flush dirty pages.  Writes persist immediately to disk at
>       a cost to performance with increased data integrity.  Otherwise
>       the periodic synch operation will flush dirty pages using the
>       synchPeriodMillis parameter in the main configuration.
>     -->
>     <property name="synchOnWrite" value="true" />
>     <property name="indexedAttributes">
>       <set>
>         <bean class="
> org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
>           <property name="attributeId" value="1.3.6.1.4.1.18060.0.4.1.2.1"
> />
>           <property name="cacheSize" value="100" />
>         </bean>
>         <bean class="
> org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration
> ">
>           <property name="attributeId" value="1.3.6.1.4.1.18060.0.4.1.2.2"
> />
>           <property name="cacheSize" value="100" />
>         </bean>
>         <bean class="
> org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
>
>           <property name="attributeId" value="1.3.6.1.4.1.18060.0.4.1.2.3"
> />
>           <property name="cacheSize" value="100" />
>         </bean>
>         <bean class="
> org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration
> ">
>           <property name="attributeId" value="1.3.6.1.4.1.18060.0.4.1.2.4"
> />
>           <property name="cacheSize" value="100" />
>         </bean>
>         <bean class="
> org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration
> ">
>           <property name="attributeId" value="1.3.6.1.4.1.18060.0.4.1.2.5" />
>           <property name="cacheSize" value="10" />
>         </bean>
>         <bean class="
> org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
>           <property name="attributeId" value="1.3.6.1.4.1.18060.0.4.1.2.6"
> />
>           <property name="cacheSize" value="10" />
>         </bean>
>         <bean class="
> org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration
> ">
>           <property name="attributeId" value="1.3.6.1.4.1.18060.0.4.1.2.7"
> />
>           <property name="cacheSize" value="10" />
>         </bean>
>
>         <bean class="
> org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
>           <property name="attributeId" value="dc" />
>           <property name="cacheSize" value="100" />
>         </bean>
>         <bean class="
> org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration
> ">
>           <property name="attributeId" value="ou" />
>           <property name="cacheSize" value="100" />
>         </bean>
>         <bean class="
> org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration
> ">
>           <property name="attributeId" value="krb5PrincipalName" />
>           <property name="cacheSize" value="100" />
>         </bean>
>         <bean class="
> org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
>
>           <property name="attributeId" value="uid" />
>           <property name="cacheSize" value="100" />
>         </bean>
>         <bean class="
> org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration
> ">
>           <property name="attributeId" value="objectClass" />
>           <property name="cacheSize" value="100" />
>         </bean>
>       </set>
>     </property>
>     <property name="contextEntry">
>       <value>
>         objectClass: top
>         objectClass: domain
>         objectClass: extensibleObject
>         dc: example
>       </value>
>     </property>
>   </bean>
>
> When I restart the ldap server, I see no partition named o=sevenSeas in
> studio, and while importing
> apache_ds_tutorial.ldif, I got:
> #!ERROR [LDAP: error code 32 - failed to add entry ou=people,o=sevenSeas:
> ou=people,o=sevenSeas]
>
> What could be the problem? Did I mis-configured something?
>
>  BTW, how could ldap server be started/stopped from command line? I always
> do a install/uninstall instead,
> which is a little laborious.
>
> When I type in "apacheds.exe ..\conf\apacheds.conf" I got the following
> error msg:
> wrapper  | --> Wrapper Started as Console
> Unable to get the current logfile size with stat: 文件名、目录名或卷标语法不正确
> 。 (0x7b)
> wrapper  | Launching a JVM...
> jvm 1    | java.lang.ExceptionInInitializerError
> Unable to get the current logfile size with stat: 文件名、目录名或卷标语法不正确
> 。 (0x7b)
> jvm 1    |      at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactor
> y.java:73)
> jvm 1    |      at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java
> :103)
> jvm 1    |      at org.apache.directory.daemon.Bootstrapper
> .<clinit>(Bootstrappe
> r.java:57)
> jvm 1    | Caused by: java.lang.IllegalArgumentException
> jvm 1    |      at sun.net.www.ParseUtil.decode(ParseUtil.java:183)
> jvm 1    |      at sun.net.www.protocol.file.Handler.openConnection(
> Handler.java
> :65)
> jvm 1    |      at sun.net.www.protocol.file.Handler.openConnection (
> Handler.java
> :55)
> jvm 1    |      at java.net.URL.openConnection(URL.java:943)
> jvm 1    |      at java.net.URL.openStream(URL.java:1007)
> jvm 1    |      at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyCon
>
> figurator.java:433)
> jvm 1    |      at
> org.apache.log4j.helpers.OptionConverter.selectAndConfigure(O
> ptionConverter.java:470)
> jvm 1    |      at org.apache.log4j.LogManager.<clinit>(LogManager.java:122)
>
> jvm 1    |      ... 3 more
> jvm 1    | Exception in thread "main"
> wrapper  | JVM exited while loading the application.
> wrapper  | There were 1 failed launches in a row, each lasting less than
> 300 sec
> onds.  Giving up.
> wrapper  |   There may be a configuration problem: please check the logs.
> wrapper  | <-- Wrapper Stopped
>
> C:\Program Files\Apache Directory Server\bin>apacheds.exe..\instances\default\c
> onf\apacheds.conf
> wrapper  | --> Wrapper Started as Console
> wrapper  | Launching a JVM...
> jvm 1    | 找不到 java 类: Main
> wrapper  | JVM exited while loading the application.
> wrapper  | CTRL-C trapped.  Shutting down.
> wrapper  | <-- Wrapper Stopped
>
> Thanks in advance.
> --
> Spark Shen
> China Software Development Lab, IBM




-- 
Ersin Er
http://www.ersin-er.name