Return-Path: X-Original-To: apmail-directory-dev-archive@www.apache.org Delivered-To: apmail-directory-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 314914638 for ; Mon, 23 May 2011 10:36:52 +0000 (UTC) Received: (qmail 15151 invoked by uid 500); 23 May 2011 10:36:52 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 15108 invoked by uid 500); 23 May 2011 10:36:52 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 15088 invoked by uid 99); 23 May 2011 10:36:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 May 2011 10:36:52 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ayyagarikiran@gmail.com designates 209.85.220.178 as permitted sender) Received: from [209.85.220.178] (HELO mail-vx0-f178.google.com) (209.85.220.178) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 May 2011 10:36:44 +0000 Received: by vxc11 with SMTP id 11so4783321vxc.37 for ; Mon, 23 May 2011 03:36:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=q7c/7viLhbMoqA10LvsqbsUf+yHgqUwskx+hODgu56g=; b=BE5qCiB5XYRkLr8ZsvS0Z2p+wVTwOnjgy5eMQIYBZs1OEZ94SpvVc+TUpjB0XZT/IF C8vUOMpF6Ww6z/Vn4vggC4J5EZb53jBQAX++YCQX2ZlYPeMBcXNItSgEsuo+IOU3lN86 JpXYoI0aqSrL8j+5f52mDv0Zq0tWSPLd2P76c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=KUrUtxy8GU8ScHAsJR1HF9qWZnnJZ8EBXEo9yfi/F2jw0J9jX1n8r/6QnIctw6C86X bwcgTiBK2QptjjgqmyavPE1NR5dKrWv3YMBplyLQh1reQl7KHP+9WAZiwHkmLsbrqW/8 erlGTdLGpdz472LmyFaTtmSFeD+XNUKE5RMdM= MIME-Version: 1.0 Received: by 10.52.179.193 with SMTP id di1mr3292056vdc.147.1306146983877; Mon, 23 May 2011 03:36:23 -0700 (PDT) Sender: ayyagarikiran@gmail.com Received: by 10.52.184.35 with HTTP; Mon, 23 May 2011 03:36:23 -0700 (PDT) In-Reply-To: References: <4DD96690.8070200@datanomic.com> Date: Mon, 23 May 2011 16:06:23 +0530 X-Google-Sender-Auth: Sgfqy0mCnCiiP6SweRveIU48SVM Message-ID: Subject: Re: Embedding ApacheDS using DirectoryServiceBean etc From: Kiran Ayyagari To: Apache Directory Developers List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Mon, May 23, 2011 at 3:57 PM, Richard Evans wrote: > OK, I'll have to rethink. =A0It's a bit disappointing since we've used XM= L configuration for each of the other applications we embed - ActiveMQ, Apa= che FTP server and Apache SSHD. > how about creating a new class which includes just the schema loading part and configure it in the XML? > Richard > > -----Original Message----- > From: ayyagarikiran@gmail.com [mailto:ayyagarikiran@gmail.com] On Behalf = Of Kiran Ayyagari > Sent: 23 May 2011 10:53 > To: Apache Directory Developers List > Subject: Re: Embedding ApacheDS using DirectoryServiceBean etc > > On Mon, May 23, 2011 at 3:16 PM, Richard Evans > wrote: >> OK, I was trying to configure a directory server using configuration bea= ns and the service builder, as recommended in an earlier mail: >> >> "And to achieve a similar configuration like above use the various XXXBe= an (e.x DirectoryServiceBean) classes present in server-config module. >> You can configure them in your spring file and then use ServiceBuilder t= o create the respective service/server instances based on these configurati= on beans." >> > well, you can use the beans for *configuring* the server, not to > launch it or perform some load operations automatically. > >> So I guess this is not possible - I need to write some code to create th= e schema loader, etc? =A0In 1.5.7 I could configure everything using an XML= file. =A0I would like to take this approach so that the configuration can = be changed easily by editing the XML rather than recompiling bits of code. >> >> Richard >> >> -----Original Message----- >> From: ayyagarikiran@gmail.com [mailto:ayyagarikiran@gmail.com] On Behalf= Of Kiran Ayyagari >> Sent: 23 May 2011 10:42 >> To: Apache Directory Developers List >> Subject: Re: Embedding ApacheDS using DirectoryServiceBean etc >> >> On Mon, May 23, 2011 at 2:27 PM, Richard Evans >> wrote: >>> I'm not sure I get this. =A0It seems as though using DirectoryServiceBe= an and ServiceBuilder just can never work because of this NPE. =A0Surely th= at's a bug? =A0I do create a schema manager in the XML: >>> >>> =A0 >>> =A0 =A0... >>> =A0 >>> >>> =A0 >>> =A0 =A0 >>> =A0 =A0 >>> =A0 =A0 >>> =A0 >>> >>> =A0 >>> =A0 =A0... >>> =A0 >>> >>> =A0 >>> >> what I mean is that the schema manager created in this way is not >> useful unless a schema loader is set. >> >> =A0 the procedure goes like this: >> >> =A0 =A0 =A0 =A0SchemaLoader loader =3D new LdifSchemaLoader( >> schemaPartitionDirectory ); // <-- you can also use >> JarLdifSchemaLoader >> =A0 =A0 =A0 =A0schemaManager =3D new DefaultSchemaManager( loader ); >> >> =A0 =A0 =A0 =A0// We have to load the schema now, otherwise we won't be = able >> =A0 =A0 =A0 =A0// to initialize the Partitions, as we won't be able to p= arse >> =A0 =A0 =A0 =A0// and normalize their suffix Dn >> =A0 =A0 =A0 =A0schemaManager.loadAllEnabled(); >> >> HTH >>> Richard >>> >>> -----Original Message----- >>> From: ayyagarikiran@gmail.com [mailto:ayyagarikiran@gmail.com] On Behal= f Of Kiran Ayyagari >>> Sent: 22 May 2011 21:02 >>> To: Apache Directory Developers List >>> Subject: Re: Embedding ApacheDS using DirectoryServiceBean etc >>> >>> On Mon, May 23, 2011 at 1:10 AM, Richard Evans >>> wrote: >>>> I'm experimenting with embedding ApacheDS (1.5.8-SNAPSHOT built from t= runk) >>>> using configuration beans created in Spring XML along with the >>>> ServiceBuilder. =A0I've attached where I've got to so far - it is not >>>> complete, but I've run into a couple of problems. >>>> >>>> Firstly I get an NPE: >>>> >>>> java.lang.NullPointerException >>>> =A0 =A0at >>>> org.apache.directory.server.core.schema.registries.synchronizers.Regis= trySynchronizerAdaptor.(RegistrySynchronizerAdaptor.java:123) >>>> =A0 =A0at >>>> org.apache.directory.server.core.schema.SchemaPartition.doInit(SchemaP= artition.java:224) >>>> =A0 =A0at >>>> org.apache.directory.server.core.partition.AbstractPartition.initializ= e(AbstractPartition.java:73) >>>> =A0 =A0at >>>> org.apache.directory.server.core.DefaultDirectoryService.initialize(De= faultDirectoryService.java:1484) >>>> =A0 =A0at >>>> org.apache.directory.server.core.DefaultDirectoryService.startup(Defau= ltDirectoryService.java:962) >>>> =A0 =A0at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>>> =A0 =A0at >>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j= ava:39) >>>> =A0 =A0at >>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess= orImpl.java:25) >>>> =A0 =A0at java.lang.reflect.Method.invoke(Method.java:597) >>>> =A0 =A0at rde.tests.apacheds.LaunchADS.main(LaunchADS.java:49) >>>> >>>> It looks as though the SchemaManager instance is never set on the >>>> SchemaPartition created by DefaultSchemaService. >>>> >>> the SchemaManager won't be created by SchemaPartition automatically >>> rather we need to set it after loading >>> the schema with any of the available schema loaders. >>> >>> Take a look at the methods initSchemaLdifPartition and >>> initDirectoryService present in ApacheDsService class they might give >>> you an idea. >>> >>>> Secondly, in 1.5.7 the suffix for a partition was a string, now it's a= Dn. >>>> =A0There are lots of constructors for the Dn object - which should be = used >>>> here? >>>> >>> you can use the one which takes a single string argument while >>> configuring, but in general it is good to use the Dn(SchemaManager, >>> String...) >>> if you have access to the schema manager. >>>> Thanks >>>> >>>> Richard >>>> >>> >>> >>> >>> -- >>> Kiran Ayyagari >>> >> >> >> >> -- >> Kiran Ayyagari >> > > > > -- > Kiran Ayyagari > --=20 Kiran Ayyagari