Thanks for the explanation. It would be good to check if the latest
changes will still work with your setup.
In your case, you'd remove the jspwiki.propertyfile parameter element
from each of your five config files and rename the
jspwiki-common.properties to jspwiki-custom.properties, and just place
the file in $CATALINA_HOME/lib. JSPWiki should automatically detect it.
(You're also welcome to remove every element from the new
jspwiki-custom.properties that has the same value in the default
jspwiki.properties distributed in the WAR, nicely shrinking it.) I'm
hoping though the "jspwiki.propertyfile.cascade.x"... configuration will
still work but I fear will it will modify the default jspwiki.properties
and not the jspwiki-custom.properties as it should. Hmm, more hacking
may be necessary on our side--at least it should be renamed to
jspwiki.custom.cascade.x...
Glen
On 08/18/2013 05:32 PM, Adrien Beau wrote:
On Fri, Aug 16, 2013 at 12:19 PM, Harry Metske <[email protected]> wrote:
indeed , tomcat has no option to have webapp specific classloading and
therefore it is war surgery.
Other appservers might have, for example WebSphere has so called shared
libraries that can be assigned to one or more applications, so you can have
different configurations for multiple wiki's without war-surgery.
You can have webapp specific system properties in Tomcat. Currently, I
have 5 separate JSPWiki instances in the same Tomcat instance, all
running from the same JSPWiki WAR, but each with a specific property
file.
I'm still using 2.10.0-svn-10, so this is from before the recent
property changes. I'm using Tomcat 7.0.42, but I believe this was
already working in Tomcat 6.
In the Tomcat conf/Catalina/localhost directory, I have five "Context"
XML files (one per JSPWiki instance). They all follow the same simple
pattern. For example, here's my Perso.xml context file, which creates
a "Perso" JSPWiki instance (accessible from
http://<tomcat:port>/Perso/):
<?xml version="1.0" encoding="UTF-8"?>
<Context docBase="F:/app/jspwiki-2.10.0-svn-10" swallowOutput="true">
<Parameter override="false"
name="jspwiki.propertyfile"
value="F:/app/jspwiki-2.10.0-svn-10/WEB-INF/jspwiki-common.properties"/>
<Parameter override="false"
name="jspwiki.propertyfile.cascade.1"
value="F:/wiki/perso/conf/override.properties"/>
</Context>
docBase is where I extracted the JSPWiki WAR file
(F:/app/jspwiki-2.10.0-svn-10 in my case).
Inside the WEB-INF directory of the WAR file, I put a
jspwiki-common.properties file that contains all settings common to
all my JSPWiki instances. This is the jspwiki.propertyfile parameter,
which is the same in all contexts.
Inside a directory dedicated to my Perso JSPWiki instance, I put a
override.properties file that contains the settings specific to the
Perso JSPWiki instance. This is the jspwiki.propertyfile.cascade.1
parameter, which is different in every context.
Once defined in a context file, despite originating from the same WAR,
the web apps behave fully independently from each other. They have
their own work directories, their own sessions, etc.
Regards,
Adrien