Hello together,

We would like to run James3 as WebApplication inside Tomcat.

The configuration directory (conf) is located inside the war file, and is 
deployed to the WEB-INF directory.
This is a problem, if we like to redeploy or to update the war file. E.g. if we 
would update from beta4 to beta5, we may lose the config files.
So it would be nice to offer an option to define the conf directory (to lay 
outside of the deployed directory structure).

The JamesServerWebApplicationContext does define a root directory of
"return 
JamesServerWebApplicationContext.this.getServletContext().getRealPath("/");"

This is fine, cause we only want to define the "conf" directory, not the "var" 
directory and so on.
We do not want to change the ServletContext, cause this may tend to create 
other problems.

The WebApp Context could be changed per installation, by creating a independent 
file "<webappname>.xml" inside /Catalina/localhost/".

I could not find any option to change the conf directory path.
Is this right? Is there an option?

Now there are some possible solutions to us:

-          Create a own WebApplicationContext class, and change the web.xml 
file to use this class, and deploy that.

o   Would work for our application.

-          Update the existing JamesServerWebApplicationContext class, to allow 
flexible configuration of the directories via

o   A runtime environment variable (System environment)

o   An entry in the webapp Context (web.xml, or 
/Catalina/localhost/james-server-app-3.0.0-beta5-SNAPSHOT.xml)

o   Or both, in order, with fallback to 
JamesServerWebApplicationContext.this.getServletContext().getRealPath("/");.

I would tend to do the last one, what do you mean?
We would implement and offer pull request on github, if you like.

Best regards,
Bernd Waibel

Reply via email to