This sounds like it is related to this issue, which is fixed but we need to do a release of 1.0.3, or you can build from SVN in the mean time.

https://issues.apache.org/jira/browse/DIRSERVER-926

Thanks,
Chris

On 8/3/07, Hendrik Saly <hsa@gmx.org> wrote:
Hello,

while running apache ds embedded in an unit test szenario i run into the problem that after shutdown the server socket is not
released/closed. The next unittest which tries to startup the directory server from scratch breaks down because of an "adress
already in use exception".

I used the sample code to start/shudown from
http://directory.apache.org/apacheds/1.0/embedding-apacheds-as-a-web-application.data/StartStopListener.java

Environment:
Apache DS 1.0.2
Java 1.4.2

Any clues?

Thanks
-Hendrik