directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emmanuel Lecharny (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (DIRSERVER-1576) DefaultDirectoryService uses Set operations on Partitions that don't implement equals
Date Thu, 09 Jun 2011 09:02:00 GMT

     [ https://issues.apache.org/jira/browse/DIRSERVER-1576?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Emmanuel Lecharny resolved DIRSERVER-1576.
------------------------------------------

    Resolution: Fixed

Applied a patch that check that the backend is correctly updated before updating the set.
: http://svn.apache.org/viewvc?rev=1133725&view=rev


> DefaultDirectoryService uses Set operations on Partitions that don't implement equals
> -------------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-1576
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1576
>             Project: Directory ApacheDS
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.5.7
>            Reporter: Andrew Swan
>            Priority: Minor
>             Fix For: 2.0.0-M1
>
>
> org.apache.directory.server.core.DefaultDirectoryService performs both "add" and "remove"
operations on Sets of Partitions, however because most of the concrete Partition classes don't
override equals, these operations don't work as you might expect. The Set should be changed
to a Collection or Map, with addition or removal being based on whether any element contains
the same suffix DN as the one being added or removed. This would avoid stack traces like this
one:
> javax.naming.ConfigurationException: ERR_263 Duplicate partition suffix: 0.9.2342.19200300.100.1.25=example,0.9.2342.19200300.100.1.25=
> com
>         at org.apache.directory.server.core.partition.DefaultPartitionNexus.addContextPartition(DefaultPartitionNexus.java:911)
>         at org.apache.directory.server.core.partition.DefaultPartitionNexus.doInit(DefaultPartitionNexus.java:245)
>         at org.apache.directory.server.core.partition.AbstractPartition.initialize(AbstractPartition.java:65)
>         at org.apache.directory.server.core.DefaultDirectoryService.initialize(DefaultDirectoryService.java:1437)
>         at org.apache.directory.server.core.DefaultDirectoryService.startup(DefaultDirectoryService.java:907)
>         at org.apache.directory.server.core.factory.DefaultDirectoryServiceFactory.build(DefaultDirectoryServiceFactory.java:215)
>         at org.apache.directory.server.core.factory.DefaultDirectoryServiceFactory.init(DefaultDirectoryServiceFactory.java:114)
>         at org.apache.directory.server.core.integ.FrameworkRunner.run(FrameworkRunner.java:172)
>         at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
> The workaround in the above case is for the caller of DirectoryService#addPartition to
first check whether the Set returned by DirectoryService#getPartitions already contains a
partition with the suffix being added. This duplication check should of course be encapsulated
within the DirectoryService.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message