[EMAIL PROTECTED] 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 ("javax.servlet.context.tempdir");
...
MutableServerStartupConfiguration cfg =
    new MutableServerStartupConfiguration();
cfg.setWorkingDirectory(workingDir);
...

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,
    Stefan




Reply via email to