hi Alan,

On 3/19/10 8:42 PM, Alan Hazelton wrote:
I have written an interceptor that makes use of a custom AttributeType
and it works fine when I manually import that AttributeType via an ldif
import. I want to make my interceptor more robust by automatically
registering the AttributeType on startup if it is not yet defined. I
tried the code below but I get a
"javax.naming.ServiceUnavailableException: Directory service is not
started." error when I add the entry. What is the correct way to add a
new AttributeType within an interceptor?

the as the exception says the DirectoryService is *yet* to be started
cause it is still in the initialization mode.

One way to make sure your entry gets registered automatically after startup is to use the DirectoryService.setTestEntries() method passing the new AttributeType definition as a LdifEntry.

HTH

Kiran Ayyagari

Reply via email to