HOW-TO: SlideRealm, Tomcat, and Domain.xml (Slide version: nightly 06/18)
(based upon Ridge Ren's Using Slide Realm posting Sun, 29 Sep 2002)
1. Uncommented the <security-constraint> in slide web.xml
2. Replace the Realm in Tomcat server.xml with:
<Realm className="wrappers.catalina.SlideRealm"
name="Slide DAV Server"
namespace="slide"
/>
3. Copy all (yeah all) of the slide jars to the
$TOMCAT_HOME/common/lib directory (this is needed because adding the
SlideRealm class to Tomcat pulls in the rest of Slide).
4. Now what the heck to do about slide.properties, that is, how to find
the location of Domain.xml. You see, now that Slide is being loaded
not as a servlet but as a part of the Tomcat core, the location of
Domain.xml is not relative to some webapps location. So, first, the
Slide class org/apache/slide/util/Configuration.java is where
the one (or more!!) slide.properties are loaded.
First, it tries to load "/org/apache/slide/slide.properties" as a resource
from the $TOMCAT_HOME/common/lib/slide-kernel.jar.
Second, it looks for the file $JAVA_HOME/lib/slide.properties and if
found it loads it.
Lastly, it tries to load the resource "/slide.properties". If one
places a slide.properties file in the directory
$TOMCAT_HOME/common/classes, this step will load the file (note: not the
$TOMCAT_HOME/shared/classes directory because we are loading at Tomcat
startup, not servlet invocation). In the log you will see the message:
"Configuration found in classpath" indicating that it found this
version of the slide.properties file (in fact, this shows up twice in the
log, Configuration.load() is called twice, and I think its because
there are more than one ClassLoaders involved??).
Clearly, messing around with the slide.properties in slide-kernel.jar
is not the way to go until you've worked out all the property settings.
Rather, simply put a copy of the slide.properties in
$TOMCAT_HOME/common/classes and define the location of the Domain.xml
file there. Because Slide is being loaded as part of Tomcat, the
value of the System property "user.dir" is the Tomcat bin directory,
$TOMCAT_HOME/bin, and this is where all relative directory locations
are from. The class org.apache.slide.common.Domain simply tries to
load the file with the implicit parent directory
System.getProperty("user.dir") and the file name that is the value
of the property "org.apache.slide.domain". If it can not find the
file the error message simply contains the value of the property
"org.apache.slide.domain"; it does not tell you what the implicit
parent directory is, i.e., where the heck it thinks the file is.
I simply use the following setting:
org.apache.slide.domain=../webapps/slide/Domain.xml
5. Commented out the JMX MBean in server.xml to fix
MBean exception.


Thats it.

Richard


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to