Hi,

I am completely new to LDAP and ApacheDS,
so if I am asking something silly, please bare with me.

I am trying to create Single Sign-on layer for few web apps using Spring 
Security3, CAS, ApacheDS
as per "Spring Security 3" book, ch.10.
(had many problems, latest - with CAS, but that is besides the scope here).

I changed configuration to use external ApacheDS on localhost,
Installed ApacheDS 1.5.7 & Studio 1.5.3
Tried to import sample LDIF file and on first node got an exception:


Error while importing LDIF

- [LDAP: error code 32 - NO_SUCH_OBJECT: failed for     Add Request

   javax.naming.NameNotFoundException: [LDAP: error code 32 -

NO_SUCH_OBJECT: failed for

Add Request : ClientEntry

     dn: dc=jbcppets,dc=com

     objectClass: extensibleObject

     objectClass: domain

     objectClass: top

     dc: jbcppets

: ERR_268 Cannot find a partition for dc=jbcppets,dc=com];

remaining name 'dc=jbcppets,dc=com'

         at com.sun.jndi.ldap.LdapCtx.mapErrorCode(Unknown Source)

         at com.sun.jndi.ldap.LdapCtx.processReturnCode(Unknown Source)

         at com.sun.jndi.ldap.LdapCtx.processReturnCode(Unknown Source)

         at com.sun.jndi.ldap.LdapCtx.c_createSubcontext(Unknown Source)

Googled up a few interesting replies to that problem, most said that need to 
create Partition first with 'dc=jbcppets,dc=com'

So I tried many times to add segments like that to server.xml  partitions  
section,
Following: 
http://directory.apache.org/apacheds/1.5/143-adding-your-own-partition-resp-suffix.html
Restart server, but still do NOT get new namingContexts in Root DSE.

<jdbmPartition id="sevenSeas" suffix="o=sevenSeas" />

      <jdbmPartition id="jbcppets" cacheSize="100" suffix="dc=jbcppets,dc=com" 
optimizerEnabled="true"
                syncOnWrite="true">
                <indexedAttributes>
                <jdbmIndex attributeId="dc" cacheSize="100"/>
                                <jdbmIndex attributeId="ou" cacheSize="100"/>
                                <jdbmIndex attributeId="krb5PrincipalName" 
cacheSize="100"/>
                                <jdbmIndex attributeId="uid" cacheSize="100"/>
          <jdbmIndex attributeId="objectClass" cacheSize="100"/>
                </indexedAttributes>
      </jdbmPartition>

      <jdbmPartition id="jbcppets" cacheSize="100" suffix="dc=jbcppets,dc=com" 
optimizerEnabled="true"  syncOnWrite="true"/>


Interestingly, although originally for  dc=example,dc=com  there was a 
namingContexts in right panel,
there was no entry in RootDSE (as per picture in documentation above),
well I added NewContextEntry, so now looks like in the doc.

Also tried to rename existing dc=example,dc=com   into example2:     
dc=example2,dc=com  there, restarted server,
but it still shows  dc=example,dc=com  ,  not example2.
Is it cached ?

Cleared IE cache.  Using Win XP.  No difference, still same problem.

Am I doing something wrong ?


Please help !

(I am attaching my full server.xml.)
TIA,
Oleg.


</pre>

<P><hr size=1></P>
<P><STRONG><font color=green>Please consider the environment before printing 
this email.</font></STRONG></P>
<P><STRONG>Visit our website at <a 
href="http://www.nyse.com";>http://www.nyse.com</a> <br>

*****************************************************************************
<br>
Note:  The information contained in this message and any attachment to it is 
privileged, confidential and protected from disclosure.  If the reader of this 
message is not the intended recipient, or an employee or agent responsible for 
delivering this message to the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this communication is strictly 
prohibited.  If you have received this communication in error, please notify 
the sender immediately by replying to the message, and please delete it from 
your system.  Thank you.  NYSE Euronext.

</STRONG></P><pre>
<?xml version="1.0" encoding="UTF-8"?>

<!--
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements.  See the NOTICE file
  distributed with this work for additional information
  regarding copyright ownership.  The ASF licenses this file
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  KIND, either express or implied.  See the License for the
  specific language governing permissions and limitations
  under the License.
-->


<spring:beans xmlns="http://apacheds.org/config/1.5.7";
       xmlns:spring="http://xbean.apache.org/schemas/spring/1.0";
       xmlns:s="http://www.springframework.org/schema/beans";>

  <defaultDirectoryService id="directoryService" instanceId="default"
                           replicaId="1"
                           workingDirectory="example.com"
                           allowAnonymousAccess="true"
                           accessControlEnabled="false"
                           denormalizeOpAttrsEnabled="false"
                           syncPeriodMillis="15000"
                           maxPDUSize="2000000">
    <systemPartition>
      <!-- use the following partitionConfiguration to override defaults for -->
      <!-- the system partition                                              -->
      <jdbmPartition id="system" cacheSize="100" suffix="ou=system" optimizerEnabled="true" syncOnWrite="true">
        <indexedAttributes>
          <jdbmIndex attributeId="1.3.6.1.4.1.18060.0.4.1.2.1" cacheSize="100"/>
          <jdbmIndex attributeId="1.3.6.1.4.1.18060.0.4.1.2.2" cacheSize="100"/>
          <jdbmIndex attributeId="1.3.6.1.4.1.18060.0.4.1.2.3" cacheSize="100"/>
          <jdbmIndex attributeId="1.3.6.1.4.1.18060.0.4.1.2.4" cacheSize="100"/>
          <jdbmIndex attributeId="1.3.6.1.4.1.18060.0.4.1.2.5" cacheSize="10"/>
          <jdbmIndex attributeId="1.3.6.1.4.1.18060.0.4.1.2.6" cacheSize="10"/>
          <jdbmIndex attributeId="1.3.6.1.4.1.18060.0.4.1.2.7" cacheSize="10"/>
          <jdbmIndex attributeId="ou" cacheSize="100"/>
          <jdbmIndex attributeId="uid" cacheSize="100"/>
          <jdbmIndex attributeId="objectClass" cacheSize="100"/>
        </indexedAttributes>
      </jdbmPartition>
    </systemPartition>

    <partitions>
      <!-- NOTE: when specifying new partitions you need not include those   -->
      <!-- attributes below with OID's which are the system indices, if left -->
      <!-- out they will be automatically configured for you with defaults.  -->        
      <jdbmPartition id="example2" cacheSize="100" suffix="dc=example2,dc=com" optimizerEnabled="true"
                     syncOnWrite="true">
        <indexedAttributes>
          <jdbmIndex attributeId="1.3.6.1.4.1.18060.0.4.1.2.1" cacheSize="100"/>
          <jdbmIndex attributeId="1.3.6.1.4.1.18060.0.4.1.2.2" cacheSize="100"/>
          <jdbmIndex attributeId="1.3.6.1.4.1.18060.0.4.1.2.3" cacheSize="100"/>
          <jdbmIndex attributeId="1.3.6.1.4.1.18060.0.4.1.2.4" cacheSize="100"/>
          <jdbmIndex attributeId="1.3.6.1.4.1.18060.0.4.1.2.5" cacheSize="10"/>
          <jdbmIndex attributeId="1.3.6.1.4.1.18060.0.4.1.2.6" cacheSize="10"/>
          <jdbmIndex attributeId="1.3.6.1.4.1.18060.0.4.1.2.7" cacheSize="10"/>
          <jdbmIndex attributeId="dc" cacheSize="100"/>
          <jdbmIndex attributeId="ou" cacheSize="100"/>
          <jdbmIndex attributeId="krb5PrincipalName" cacheSize="100"/>
          <jdbmIndex attributeId="uid" cacheSize="100"/>
          <jdbmIndex attributeId="objectClass" cacheSize="100"/>
        </indexedAttributes>
      </jdbmPartition>
      
      
      
       <jdbmPartition id="vente" cacheSize="100" suffix="dc=vente,dc=com" optimizerEnabled="true" syncOnWrite="true">  
                  <indexedAttributes>  
                     <jdbmIndex attributeId="1.3.6.1.4.1.18060.0.4.1.2.1" cacheSize="100"/>  
                     <jdbmIndex attributeId="1.3.6.1.4.1.18060.0.4.1.2.2" cacheSize="100"/>  
                     <jdbmIndex attributeId="1.3.6.1.4.1.18060.0.4.1.2.3" cacheSize="100"/>  
                     <jdbmIndex attributeId="1.3.6.1.4.1.18060.0.4.1.2.4" cacheSize="100"/>  
                     <jdbmIndex attributeId="1.3.6.1.4.1.18060.0.4.1.2.5" cacheSize="10"/>  
                     <jdbmIndex attributeId="1.3.6.1.4.1.18060.0.4.1.2.6" cacheSize="10"/>  
                     <jdbmIndex attributeId="1.3.6.1.4.1.18060.0.4.1.2.7" cacheSize="10"/>  
                     <jdbmIndex attributeId="dc" cacheSize="100"/>  
                     <jdbmIndex attributeId="ou" cacheSize="100"/>  
                     <jdbmIndex attributeId="krb5PrincipalName" cacheSize="100"/>  
                     <jdbmIndex attributeId="uid" cacheSize="100"/>  
                     <jdbmIndex attributeId="objectClass" cacheSize="100"/>  
                  </indexedAttributes>  
         </jdbmPartition>
      
      <jdbmPartition id="sevenSeas" suffix="o=sevenSeas" /> 
      
      <!-- OK: added  -->
      <jdbmPartition id="jbcppets" cacheSize="100" suffix="dc=jbcppets,dc=com" optimizerEnabled="true"
      	syncOnWrite="true">
      	<indexedAttributes>          	
          	<jdbmIndex attributeId="dc" cacheSize="100"/>
		<jdbmIndex attributeId="ou" cacheSize="100"/>
		<jdbmIndex attributeId="krb5PrincipalName" cacheSize="100"/>
		<jdbmIndex attributeId="uid" cacheSize="100"/>
          <jdbmIndex attributeId="objectClass" cacheSize="100"/>
      	</indexedAttributes>
      </jdbmPartition>
      	
      <!--jdbmPartition id="jbcppets" cacheSize="100" suffix="dc=jbcppets,dc=com" optimizerEnabled="true"
                      syncOnWrite="true"/-->
	
      <jdbmPartition id="sevenSeas1" cacheSize="100" suffix="o=sevenSeas1" optimizerEnabled="true"
                      syncOnWrite="true"/>
                     
                  
      
    </partitions>

    <interceptors>
      <normalizationInterceptor/>
      <authenticationInterceptor/>
      <referralInterceptor/>
      <aciAuthorizationInterceptor/>
      <defaultAuthorizationInterceptor/>
      <exceptionInterceptor/>
      <operationalAttributeInterceptor/>

      <!-- Uncomment to enable the password policy interceptor
      <passwordPolicyInterceptor/>
      <keyDerivationInterceptor/>
      -->

      <schemaInterceptor/>
      <subentryInterceptor/>
      <collectiveAttributeInterceptor/>
      <eventInterceptor/>
      <triggerInterceptor/>

      <!-- Uncomment to enable replication interceptor
      <replicationInterceptor>
        <configuration>
          <replicationConfiguration serverPort="10390" peerReplicas="instance_b@localhost:10392">
            <replicaId>
              <replicaId id="instance_a"/>
            </replicaId>
          </replicationConfiguration>
        </configuration>
      </replicationInterceptor>
      -->
    </interceptors>

    <!-- Uncomment to enable replication configuration -->
    <!--replicationConfiguration>
      <providers>
        <provider id="1 type="refreshAndPersist" timeLimit="1000" sizeLimit="1000">
          <url>
            ldap://ldap1.acme.com:10389/ou=data,dc=acme,dc=com?*, +?sub?(objectClass=*)
          </url>
          <connection bindMethod="simple">
            <principal> 
              uid=admin,ou=system 
            </principal> 
            <credentials>secret</credentials>
          </bind>
        </provider>
        <provider id="2 type="refreshAndPersist" timeLimit="1000" sizeLimit="1000">
          <url>
            ldaps://ldap2.acme.com:10389/ou=data,dc=acme,dc=com?*, +?sub?(objectClass=*)
          </url>
          <connection bindMethod="simple">
            <principal> 
              uid=admin,ou=system 
            </principal> 
            <credentials>secret</credentials>
          </bind>
        </provider>
      </providers>
    </replicationConfiguration-->

  </defaultDirectoryService>


  <!-- 
  +============================================================+
  | ChangePassword server configuration                        |
  +============================================================+
  -->
  <!--  missing  atou=users,dc=example,dc=com
  <changePasswordServer id="changePasswordServer">
    <transports>
      <tcpTransport port="60464" nbThreads="2" backLog="50"/>
      <udpTransport port="60464" nbThreads="2" backLog="50"/>
    </transports>
    <directoryService>#directoryService</directoryService>
  </changePasswordServer>
-->

  <!-- 
  +============================================================+
  | Kerberos server configuration                              |
  +============================================================+
  -->
  <!--  missing atou=users,dc=example,dc=com
  <kdcServer id="kdcServer">
    <transports>
      <tcpTransport port="60088" nbThreads="4" backLog="50"/>
      <udpTransport port="60088" nbThreads="4" backLog="50"/>
    </transports>
    <directoryService>#directoryService</directoryService>
  </kdcServer>
-->

  <!-- 
  +============================================================+
  | NtpServer configuration                                    |
  +============================================================+
  -->
  <!--ntpServer>
    <transports>
      <tcpTransport port="60123"/>
      <udpTransport port="60123" nbThreads="1"/>
    </transports>
  </ntpServer-->

  <!-- 
  +============================================================+
  | DnsServer configuration                                    |
  +============================================================+
  -->
  <!--  missing atou=users,dc=example,dc=com
  <dnsServer>
    <transports>
      <tcpTransport port="8053"/>
      <udpTransport port="8053"/>
    </transports>
    <directoryService>#directoryService</directoryService>
  </dnsServer>
-->

  <!-- 
  +============================================================+
  | LDAP Service configuration                                 |
  +============================================================+
  -->
  
  <!-- OK: added to searchBaseDn:  dc=jbcppets,dc=com -->
  
  <ldapServer id="ldapServer"
            allowAnonymousAccess="false"
            saslHost="ldap.example.com"
            saslPrincipal="ldap/[email protected]"
            searchBaseDn="ou=users,ou=system,dc=jbcppets,dc=com"
            maxTimeLimit="15000"
            maxSizeLimit="1000">
    <transports>
      <tcpTransport address="0.0.0.0" port="10389" nbThreads="8" backLog="50" enableSSL="false"/>
      <tcpTransport address="localhost" port="10636" enableSSL="true"/>
    </transports>

    <directoryService>#directoryService</directoryService>
    
    <!-- OK: added - We load JBCPPets root context entry here -->
    <ldifDirectory>JBCPPets.ldif</ldifDirectory>


    <!-- The list of supported authentication mechanisms.                   -->
    <saslMechanismHandlers>
      <simpleMechanismHandler mech-name="SIMPLE"/>
      <cramMd5MechanismHandler mech-name="CRAM-MD5" />
      <digestMd5MechanismHandler mech-name="DIGEST-MD5" />
      <gssapiMechanismHandler mech-name="GSSAPI" />
      <ntlmMechanismHandler mech-name="NTLM" ntlmProviderFqcn="com.foo.Bar"/>
      <ntlmMechanismHandler mech-name="GSS-SPNEGO" ntlmProviderFqcn="com.foo.Bar"/>
    </saslMechanismHandlers>

    <!-- The realms serviced by this SASL host, used by DIGEST-MD5 and GSSAPI. -->
    <saslRealms>
      <s:value>example.com</s:value>
      <s:value>apache.org</s:value>
    </saslRealms>

    <!-- the collection of extended operation handlers to install           -->
    <extendedOperationHandlers>
      <startTlsHandler/>
      <gracefulShutdownHandler/>
      <launchDiagnosticUiHandler/>
      <!-- The Stored Procedure Extended Operation is not stable yet and it may cause security risks.-->
      <!--storedProcedureExtendedOperationHandler/-->
    </extendedOperationHandlers>
  </ldapServer>

  <apacheDS id="apacheDS">
    <ldapServer>#ldapServer</ldapServer>
  </apacheDS>
  
  <!-- uncomment the below line to start the jetty(v6.1.14) http server
       This can be used to provide access to the data present in DIT via http
       using a web application
  -->
  <!-- 
   <httpServer id="httpServer" port="7009" >
   <webApps>
    <webApp warFile="/path/to/war/file" contextPath="/myApp"/>
   </webApps>
  </httpServer>
   -->
</spring:beans>

Reply via email to