Hi,
we use BaseX in a Tomcat server on Linux.
We run multiple instances of our application as different web applications
in that server. A problem we encountered is that BaseX refers to the
'user.home' property when identifying the location of its .basex
configuration file. This property is related to which (Linux) user started
the Tomcat server, which is unrelated to the web application that needs to
start a BaseX instance.
We are now using a very awkward work-around: temporarily setting 'user.home'
to the desired value, then touching a class in org.basex.core to force its
initialization:
oldUserHome = System.getProperty("user.home");
System.setProperty("user.home", basexdir);
if (!org.basex.core.Prop.HOME.startsWith(basexdir))
throw new java.lang.Error("BaseX property initialization failed");
System.setProperty("user.home", oldUserHome);
Could a programmatic way to initialize BaseX be provided that does depend on
system properties? I understand that it will require a small amount of
refactoring (given how deep this assumption is wired into the code), but it
is absolutely necessary to facilitate the use of BaseX in shared
environments such as Tomcat.
Thanks.
- Godmar