directory-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Zoerner <>
Subject Re: [ApacheDS] Example Embedded WebApp not Persisting Directory Modifications
Date Fri, 23 Mar 2007 13:15:53 GMT wrote:
> I am using the example embedded directory code. I am up and running but my 
> additions to the directory are not being persisted. If I shutdown JBoss 
> and restart the additions are gone. I am configuring the server in the 
> StartStopListener but am unsure how to fix this behavior.
> I see these methods such as shutdownHookEnabled but am unsure what that 
> does or what the default setting is.
> Any help is appreciated.

First of all please keep in mind that this generic example has proof of 
concept character. For JBoss for instance, a better integration exists 
in the form of a sar-module.

Now your problem. I have an idea.

I have tested the webapp-example with several other AppServers (Tomcat 
WebSphere, Jetty). The changes have been persisted, but this may not be 
the case for all servers. The reason is the option I have chosen for the 
working directory (which stores the JDBM files with your partitions). In 
the example code it is a temporary directory provided by the app server.

File workingDir = (File) servletContext.getAttribute 
MutableServerStartupConfiguration cfg =
     new MutableServerStartupConfiguration();

Unfortunately it is not guaranteed by the servlet specification, that a 
web application gets the same directory after a restart, and that it is 
untouched ...

How about trying to programmaticaly select another directory and see 
whether changes are saved between restarts.

Greetings from Hamburg,

View raw message