You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@directory.apache.org by Sylvain RICHET <sr...@bee-ware.net> on 2007/12/13 15:06:17 UTC

Howto augment PROGRAMMATICALLY default Schema in APacheDS 1.5.0 ?

Hi,

I want to augment the default schema of ApacheDS 1.5.0. in a unit test
(extending org.apache.directory.server.unit.AbstractServerTest)

This should be easy... but it's not

The tip given here fails :
http://directory.apache.org/apacheds/1.5/add-your-first-elements-to-the-schema.html#Addyourfirstelementstotheschema-UsingJNDItoaddtheschemaelementsprogrammatically

The thrown error is :
java.lang.UnsupportedOperationException
    at 
org.apache.directory.server.core.jndi.ServerDirContext.getSchema(ServerDirContext.java:432)
    ...


Here, someone noticed the... bug (?) :
http://www.nabble.com/-ldapserver--schema--How-to-programmatically-extract-schema-information-from-a-server-context-to13524142.html


I didn't find any workaround yet...


Thanks in advance

Re: Howto augment PROGRAMMATICALLY default Schema in APacheDS 1.5.0 ?

Posted by Emmanuel Lecharny <el...@gmail.com>.
Sylvain RICHET wrote:
>
> Ok, Emmanuel
>
> Thanks for your response.
>
> I wait for new Apache DS updated docs for Christmas !
> ;-)
NP, you will have it in your boots :)
>
>


-- 
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org



Re: Howto augment PROGRAMMATICALLY default Schema in APacheDS 1.5.0 ?

Posted by Alex Karasulu <ak...@apache.org>.
So you need all the jars eh?  There's many ways you can do this:

(1) You can check out the sources for this release and build it:
     http://svn.apache.org/repos/asf/directory/apacheds/releases/1.5.1

(2) You can pull down the jars you need from the production maven
repositories in several ways:
     (a) if your project uses maven as the build too you can pull it down
automatically with a single dependency that pulls the other dependencies
(ant can do this too with maven tasks)
     (b) with wget or your browser if you don't use maven

     http://ibiblio.org/maven2/org/apache/directory/server

(3) You can download another format of the installer and just access that
distributions lib directory.  This noarch one is a hack job.  Our installer
guy got taken away from us before he could complete this stuff this was
assembled from an uber jar (an assembly or jar of all the other jars and
their dependencies exploded).  Obviously our present setup really stinks.
We just don't have the volunteers to focus on installers at this stage.

No with respect to augmenting the schema in your unit tests we have several
test cases in core-unit and server-unit modules that do just this.  This
might not be the same after 1.5.1 but for 1.5.1 you should look into for
example these test cases:

    *http://tinyurl.com/2g2dft

*There are other tests around schema in this package.  Some which enable and
disable pre-installed schemas.

I think your concerns and problems require a nice little facade around the
schema subsystem which we can use to just enable, disable and load new
schemas just to make people's lives easier.  Feel free to file a new JIRA
issue for these convenience methods.

HTH,
Alex

On Dec 19, 2007 9:50 AM, Sylvain RICHET <sr...@bee-ware.net> wrote:

> Hi Pierre-Arnaud,
>
> Starting Apache DS NoArch by launching the script 'apacheds.sh'  ... OK !
> No problem.
>
> But, what i need is all the ApacheDS 1.5.1 libraries,
> to integrate them in my project for integration tests...
>
> Launching the script 'apacheds.sh' doesn't extract these libraries !
> Does it ?
>  ;-)
>
>
>
>
>
>

Re: Howto augment PROGRAMMATICALLY default Schema in APacheDS 1.5.0 ?

Posted by Sylvain RICHET <sr...@bee-ware.net>.
Hi Pierre-Arnaud,

Starting Apache DS NoArch by launching the script 'apacheds.sh'  ... OK !
No problem.

But, what i need is all the ApacheDS 1.5.1 libraries,
to integrate them in my project for integration tests...

Launching the script 'apacheds.sh' doesn't extract these libraries !
Does it ?
 ;-) 






Re: Howto augment PROGRAMMATICALLY default Schema in APacheDS 1.5.0 ?

Posted by Pierre-Arnaud Marcelot <pa...@marcelot.net>.
Hi Sylvain,

You can start Apache DS NoArch by launching the script 'apacheds.sh' or '
apacheds.bat', depending on your OS.

Hope this helps,
Pierre-Arnaud Marcelot


On 12/19/07, Sylvain RICHET <sr...@bee-ware.net> wrote:
>
> Emmanuel Lecharny a écrit :
> > Hi,
> >
> > I have tested the code against the trunk (which will become 1.5.2) and
> > it works well. Have you tried the samples against the 1.5.1 version,
> > which fixed a hell lot of problems ?
> >
> > Sylvain RICHET wrote:
> >> Emmanuel Lecharny a écrit :
> >>> Hi Sylvain,
> >>>
> >>> sorry for the delay. We will check the site to see if there is any
> >>> kind of problem in the documentation, and will keep you informed asap.
> >>>
> >>> Thanks for using ADS !
> >>>
> >>>
> >>>
> >>> On Dec 13, 2007 3:06 PM, Sylvain RICHET <sr...@bee-ware.net> wrote:
> >>>
> >>>> Hi,
> >>>>
> >>>> I want to augment the default schema of ApacheDS 1.5.0. in a unit
> test
> >>>> (extending org.apache.directory.server.unit.AbstractServerTest)
> >>>>
> >>>> This should be easy... but it's not
> >>>>
> >>>> The tip given here fails :
> >>>>
> http://directory.apache.org/apacheds/1.5/add-your-first-elements-to-the-schema.html#Addyourfirstelementstotheschema-UsingJNDItoaddtheschemaelementsprogrammatically
> >>>>
> >>>>
> >>>> The thrown error is :
> >>>> java.lang.UnsupportedOperationException
> >>>>     at
> >>>> org.apache.directory.server.core.jndi.ServerDirContext.getSchema(
> ServerDirContext.java:432)
> >>>>
> >>>>     ...
> >>>>
> >>>>
> >>>> Here, someone noticed the... bug (?) :
> >>>>
> http://www.nabble.com/-ldapserver--schema--How-to-programmatically-extract-schema-information-from-a-server-context-to13524142.html
> >>>>
> >>>>
> >>>>
> >>>> I didn't find any workaround yet...
> >>>>
> >>>>
> >>>> Thanks in advance
> >>>>
> >>>>
> >>>
> >>>
> >>>
> >>>
> >>
> >> Ok, Emmanuel
> >>
> >> Thanks for your response.
> >>
> >> I wait for new Apache DS updated docs for Christmas !
> >> ;-)
> >>
> >>
> >
> >
> Yep !
>
> I have donwloaded a tarball file "apacheds-noarch-1.5.1.tar.gz"
> (url :
> http://www.apache.org/dyn/closer.cgi/directory/apacheds/unstable/1.5/1.5.1
> )
>
> Then, untaring it gives a jar file, in ./apacheds-noarch/target directory
> :
> "apacheds-noarch-installer-1.5.1-app.jar"
>
> But, launching :
> java -jar ./apacheds-noarch/target/apacheds-noarch-installer-1.5.1-app.jar
>           _                     _          ____  ____
>          / \   _ __   __ _  ___| |__   ___|  _ \/ ___|
>         / _ \ | '_ \ / _` |/ __| '_ \ / _ \ | | \___ \
>        / ___ \| |_) | (_| | (__| | | |  __/ |_| |___) |
>       /_/   \_\ .__/ \__,_|\___|_| |_|\___|____/|____/
>
> |_|
>
> Exception in thread "main" java.lang.NullPointerException
>        at org.apache.directory.server.Service.init(Service.java:73)
>        at org.apache.directory.server.UberjarMain.main(UberjarMain.java
> :59)
>
>
>
> So, i can't get the ApacheDS 1.5.1 libraries (which should be in a ./lib
> sub-directory) !!
> That's the reason why i couldn't test schemas under ApacheDS 1.5.1...
>
> Any workaround ?
> Thanks in advance
>
>
>
>

Re: Howto augment PROGRAMMATICALLY default Schema in APacheDS 1.5.0 ?

Posted by Sylvain RICHET <sr...@bee-ware.net>.
Emmanuel Lecharny a écrit :
> Hi,
>
> I have tested the code against the trunk (which will become 1.5.2) and 
> it works well. Have you tried the samples against the 1.5.1 version, 
> which fixed a hell lot of problems ?
>
> Sylvain RICHET wrote:
>> Emmanuel Lecharny a écrit :
>>> Hi Sylvain,
>>>
>>> sorry for the delay. We will check the site to see if there is any
>>> kind of problem in the documentation, and will keep you informed asap.
>>>
>>> Thanks for using ADS !
>>>
>>>
>>>
>>> On Dec 13, 2007 3:06 PM, Sylvain RICHET <sr...@bee-ware.net> wrote:
>>>  
>>>> Hi,
>>>>
>>>> I want to augment the default schema of ApacheDS 1.5.0. in a unit test
>>>> (extending org.apache.directory.server.unit.AbstractServerTest)
>>>>
>>>> This should be easy... but it's not
>>>>
>>>> The tip given here fails :
>>>> http://directory.apache.org/apacheds/1.5/add-your-first-elements-to-the-schema.html#Addyourfirstelementstotheschema-UsingJNDItoaddtheschemaelementsprogrammatically 
>>>>
>>>>
>>>> The thrown error is :
>>>> java.lang.UnsupportedOperationException
>>>>     at
>>>> org.apache.directory.server.core.jndi.ServerDirContext.getSchema(ServerDirContext.java:432) 
>>>>
>>>>     ...
>>>>
>>>>
>>>> Here, someone noticed the... bug (?) :
>>>> http://www.nabble.com/-ldapserver--schema--How-to-programmatically-extract-schema-information-from-a-server-context-to13524142.html 
>>>>
>>>>
>>>>
>>>> I didn't find any workaround yet...
>>>>
>>>>
>>>> Thanks in advance
>>>>
>>>>     
>>>
>>>
>>>
>>>   
>>
>> Ok, Emmanuel
>>
>> Thanks for your response.
>>
>> I wait for new Apache DS updated docs for Christmas !
>> ;-)
>>
>>
>
>
Yep !

I have donwloaded a tarball file "apacheds-noarch-1.5.1.tar.gz"
(url : 
http://www.apache.org/dyn/closer.cgi/directory/apacheds/unstable/1.5/1.5.1)

Then, untaring it gives a jar file, in ./apacheds-noarch/target directory :
"apacheds-noarch-installer-1.5.1-app.jar"

But, launching :
java -jar ./apacheds-noarch/target/apacheds-noarch-installer-1.5.1-app.jar
           _                     _          ____  ____  
          / \   _ __   __ _  ___| |__   ___|  _ \/ ___| 
         / _ \ | '_ \ / _` |/ __| '_ \ / _ \ | | \___ \  
        / ___ \| |_) | (_| | (__| | | |  __/ |_| |___) | 
       /_/   \_\ .__/ \__,_|\___|_| |_|\___|____/|____/  
               
|_|                                                              

Exception in thread "main" java.lang.NullPointerException
        at org.apache.directory.server.Service.init(Service.java:73)
        at org.apache.directory.server.UberjarMain.main(UberjarMain.java:59)



So, i can't get the ApacheDS 1.5.1 libraries (which should be in a ./lib 
sub-directory) !!
That's the reason why i couldn't test schemas under ApacheDS 1.5.1...

Any workaround ?
Thanks in advance




Re: Howto augment PROGRAMMATICALLY default Schema in APacheDS 1.5.0 ?

Posted by Emmanuel Lecharny <el...@gmail.com>.
Hi,

I have tested the code against the trunk (which will become 1.5.2) and 
it works well. Have you tried the samples against the 1.5.1 version, 
which fixed a hell lot of problems ?

Sylvain RICHET wrote:
> Emmanuel Lecharny a écrit :
>> Hi Sylvain,
>>
>> sorry for the delay. We will check the site to see if there is any
>> kind of problem in the documentation, and will keep you informed asap.
>>
>> Thanks for using ADS !
>>
>>
>>
>> On Dec 13, 2007 3:06 PM, Sylvain RICHET <sr...@bee-ware.net> wrote:
>>  
>>> Hi,
>>>
>>> I want to augment the default schema of ApacheDS 1.5.0. in a unit test
>>> (extending org.apache.directory.server.unit.AbstractServerTest)
>>>
>>> This should be easy... but it's not
>>>
>>> The tip given here fails :
>>> http://directory.apache.org/apacheds/1.5/add-your-first-elements-to-the-schema.html#Addyourfirstelementstotheschema-UsingJNDItoaddtheschemaelementsprogrammatically 
>>>
>>>
>>> The thrown error is :
>>> java.lang.UnsupportedOperationException
>>>     at
>>> org.apache.directory.server.core.jndi.ServerDirContext.getSchema(ServerDirContext.java:432) 
>>>
>>>     ...
>>>
>>>
>>> Here, someone noticed the... bug (?) :
>>> http://www.nabble.com/-ldapserver--schema--How-to-programmatically-extract-schema-information-from-a-server-context-to13524142.html 
>>>
>>>
>>>
>>> I didn't find any workaround yet...
>>>
>>>
>>> Thanks in advance
>>>
>>>     
>>
>>
>>
>>   
>
> Ok, Emmanuel
>
> Thanks for your response.
>
> I wait for new Apache DS updated docs for Christmas !
> ;-)
>
>


-- 
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org



Re: Howto augment PROGRAMMATICALLY default Schema in APacheDS 1.5.0 ?

Posted by Sylvain RICHET <sr...@bee-ware.net>.
Emmanuel Lecharny a écrit :
> Hi Sylvain,
>
> sorry for the delay. We will check the site to see if there is any
> kind of problem in the documentation, and will keep you informed asap.
>
> Thanks for using ADS !
>
>
>
> On Dec 13, 2007 3:06 PM, Sylvain RICHET <sr...@bee-ware.net> wrote:
>   
>> Hi,
>>
>> I want to augment the default schema of ApacheDS 1.5.0. in a unit test
>> (extending org.apache.directory.server.unit.AbstractServerTest)
>>
>> This should be easy... but it's not
>>
>> The tip given here fails :
>> http://directory.apache.org/apacheds/1.5/add-your-first-elements-to-the-schema.html#Addyourfirstelementstotheschema-UsingJNDItoaddtheschemaelementsprogrammatically
>>
>> The thrown error is :
>> java.lang.UnsupportedOperationException
>>     at
>> org.apache.directory.server.core.jndi.ServerDirContext.getSchema(ServerDirContext.java:432)
>>     ...
>>
>>
>> Here, someone noticed the... bug (?) :
>> http://www.nabble.com/-ldapserver--schema--How-to-programmatically-extract-schema-information-from-a-server-context-to13524142.html
>>
>>
>> I didn't find any workaround yet...
>>
>>
>> Thanks in advance
>>
>>     
>
>
>
>   

Ok, Emmanuel

Thanks for your response.

I wait for new Apache DS updated docs for Christmas !
;-)


Re: Howto augment PROGRAMMATICALLY default Schema in APacheDS 1.5.0 ?

Posted by Emmanuel Lecharny <el...@gmail.com>.
Hi Sylvain,

sorry for the delay. We will check the site to see if there is any
kind of problem in the documentation, and will keep you informed asap.

Thanks for using ADS !



On Dec 13, 2007 3:06 PM, Sylvain RICHET <sr...@bee-ware.net> wrote:
> Hi,
>
> I want to augment the default schema of ApacheDS 1.5.0. in a unit test
> (extending org.apache.directory.server.unit.AbstractServerTest)
>
> This should be easy... but it's not
>
> The tip given here fails :
> http://directory.apache.org/apacheds/1.5/add-your-first-elements-to-the-schema.html#Addyourfirstelementstotheschema-UsingJNDItoaddtheschemaelementsprogrammatically
>
> The thrown error is :
> java.lang.UnsupportedOperationException
>     at
> org.apache.directory.server.core.jndi.ServerDirContext.getSchema(ServerDirContext.java:432)
>     ...
>
>
> Here, someone noticed the... bug (?) :
> http://www.nabble.com/-ldapserver--schema--How-to-programmatically-extract-schema-information-from-a-server-context-to13524142.html
>
>
> I didn't find any workaround yet...
>
>
> Thanks in advance
>



-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com