Return-Path: Delivered-To: apmail-directory-users-archive@www.apache.org Received: (qmail 98115 invoked from network); 9 Aug 2010 13:27:00 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 9 Aug 2010 13:27:00 -0000 Received: (qmail 32751 invoked by uid 500); 9 Aug 2010 13:27:00 -0000 Delivered-To: apmail-directory-users-archive@directory.apache.org Received: (qmail 32533 invoked by uid 500); 9 Aug 2010 13:26:57 -0000 Mailing-List: contact users-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@directory.apache.org Delivered-To: mailing list users@directory.apache.org Delivered-To: moderator for users@directory.apache.org Received: (qmail 31403 invoked by uid 99); 9 Aug 2010 13:24:27 -0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) thread-index: Acs3xh8DlBWFHLAgT1eRbXi8CI21rA== From: "Carsten Kaiser" Content-Transfer-Encoding: 7bit Content-Type: multipart/alternative; boundary="Apple-Mail-535-257841112" Subject: [ApacheDS] Embedded: Cannot create subcontext beneath newly created sub context()... Date: Mon, 9 Aug 2010 15:23:55 +0200 Content-Class: urn:content-classes:message Importance: normal Priority: normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4657 Message-ID: To: MIME-Version: 1.0 X-Mailer: Apple Mail (2.1081) X-OriginalArrivalTime: 09 Aug 2010 13:23:56.0838 (UTC) FILETIME=[1EB45C60:01CB37C6] X-TM-AS-Product-Ver: SMEX-8.0.0.1181-6.500.1024-17558.007 X-TM-AS-Result: No--11.060700-0.000000-31 X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail-535-257841112 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="iso-8859-1" Hello there, I'am a newbie to LDAP and I'm trying to use ApacheDS as embedded LDAPServer for our integration tests. It took my quite some time to figure out, how to get the web application up and running, to add my custom schema extensions and to load my setup data. I'm using version 1.5.5 since the example code for 1.5.7 was broken and I did not want to spend much more time in getting 1.5.8-SNAPSHOT working. The schema extensions and the setup data is loaded into the system partition resp. others partition since I'm trying to simulate the later production environment, which will use Sun ONE, so I want to use the schema as it will be defined in there. Now I'am able to query my data and even to add new entries, but unfortunately I'm not able to add another entry below my newly created entries due to following error 15:06:02 [http-8088-1 ] ERROR de.aaa.AAARegistry (552) - [LDAP: error code 32 - NO_SUCH_OBJECT: failed for SearchRequest baseDn : '1.3.6.1.4.1.36200.255.0.7=' filter : '(2.5.4.0=*)' scope : base object typesOnly : false Size Limit : no limit Time Limit : no limit Deref Aliases : deref Always attributes : : Cannot find a partition for 1.3.6.1.4.1.36200.255.0.7=] javax.naming.NameNotFoundException: [LDAP: error code 32 - NO_SUCH_OBJECT: failed for SearchRequest baseDn : '1.3.6.1.4.1.36200.255.0.7=' filter : '(2.5.4.0=*)' scope : base object typesOnly : false Size Limit : no limit Time Limit : no limit Deref Aliases : deref Always attributes : : Cannot find a partition for 1.3.6.1.4.1.36200.255.0.7=]; remaining name 'servicename=/devices/v1/, vin=WVWZZZ1JZXW000002,ou=devices,c=DE,o=Branch,o=AAA,ou=system' at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3066) at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2987) at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2794) at com.sun.jndi.ldap.LdapCtx.c_lookup(LdapCtx.java:1011) at com.sun.jndi.toolkit.ctx.ComponentContext.c_resolveIntermediate_nns(ComponentContext.java:152) at com.sun.jndi.toolkit.ctx.AtomicContext.c_resolveIntermediate_nns(AtomicContext.java:342) at com.sun.jndi.toolkit.ctx.ComponentContext.p_resolveIntermediate(ComponentContext.java:381) at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_createSubcontext(ComponentDirContext.java:311) at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.createSubcontext(PartialCompositeDirContext.java:248) at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.createSubcontext(PartialCompositeDirContext.java:236) at javax.naming.directory.InitialDirContext.createSubcontext(InitialDirContext.java:178) For some reason the creation of the first subcontext works fine although it uses custom schema attribute types and object classes as well. Here is the code: public synchronized void registerProfile(AuthorizationProfile profile) throws Exception { if (profile != null) { if (log.isInfoEnabled()) { log.info(sm.getString("aaaRegistry.addProfile", profile.getName(), profile.getVin())); } try { Attributes attributes = new BasicAttributes(true); attributes.put(new BasicAttribute(DEVICE_ATTRIBUTES.VIN.name(), profile.getVin())); attributes.put(new BasicAttribute(DEVICE_ATTRIBUTES.VehicleID.name(), profile.getName())); Attribute objectClass = new BasicAttribute("objectClass", "top"); objectClass.add("vehicle"); objectClass.add("consumer"); attributes.put(objectClass); DirContext generatedContext = context.createSubcontext(profile.getDn(), attributes); if (profile.getRoles() != null && !profile.getRoles().isEmpty()) { Attributes roleAttributes; for (String role : profile.getRoles()) { roleAttributes = new BasicAttributes(true); roleAttributes.put(new BasicAttribute("serviceName", role)); roleAttributes.put(new BasicAttribute("activeFlag", "TRUE")); objectClass = new BasicAttribute("objectClass", "top"); objectClass.add("assignedService"); roleAttributes.put(objectClass); context.createSubcontext( new StringBuilder("servicename=").append(role).append(", ").append(profile.getDn()) .toString(), roleAttributes); } } } catch (NamingException e) { log.error(e.getMessage(), e); throw new Exception(sm.getString("aaaRegistry.cannotAddProfile"), e); } } } Every hint is welcome! Regards, CAK -- Carsten Kaiser Principal Consultant mailto:carsten.kaiser@valtech.de Mobile: +49 170 5270206 Valtech GmbH Werner-Heisenberg-Stra�e 2 63263 Neu-Isenburg Germany Phone: +49 6102 88468-0 Fax: +49 6102 88468-28 http://www.valtech.de Gesch�ftsf�hrer: Ingo Kriescher Amtsgericht D�sseldorf HRB48672 --Apple-Mail-535-257841112--