Le 11/07/16 à 14:36, Claude Libois a écrit :
> Hello,
> I'm using ApacheDS as embedded LDAP for unit testing.
> I'm trying to add some attribute definition through ldif file which
> contains:
> dn: cn=schema
> version: 1
> changetype: modify
> add: attributetypes
> attributetypes: ( 1.3.6.1.4.1.18060.0.4.3.2.1
>                  NAME 'subjectDn'  DESC 'dqffq'
>                  EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27
>                  SINGLE-VALUE)
> -
> With te following metadata I get
> 2016-07-11 14:31:00,392 ERROR LdifReader - ERR_12004_CHANGE_NOT_ALLOWED We
> cannot have changes when reading a file which already contains entries, at
> line 6
>
> @CreateLdapServer(
>         transports =
>                 {
>                         @CreateTransport(protocol = "LDAP")
>                 }
> )
> @CreateDS(name = "classDS",
>         partitions =
>                 {
>                         @CreatePartition(
>                                 name = "XX",
>                                 suffix = "o=XX,dc=XX,dc=be"
>                         )
>                 }
> )
> @ApplyLdifFiles({
>         "ldif/addSubjectDn.ldif",
> }
> )
> @CreateLdapConnectionPool(
>         maxActive = 1,
>         maxWait = 5000)
>
> Does anybody knows how to fix this ? I'm rather a newbye for what concerns
> LDAP so this might be something obvious.

This is not a bug, this is a limitation. Don't do a Modify, do an Add,
that should work.

Reply via email to