tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ricardo Bánffy <rica...@organic.com.br>
Subject RE: Multiple homes
Date Wed, 31 May 2000 15:22:11 GMT
Hi All

I have a simple solution for this under NT with Tomcat running as a service.

All you have to do is to copy the wrapper.properties file to, say,
other_wrapper.properties (I named the new files according to port numbers)
and let it point to "other_server.xml" where you specify the other port
number, work directory (see below) and document root. Then all you have to
do is to set up the service with this other wrapper.properties file.

Building on that, I imagine that it's possible to start Tomcat via the
scrips provided in the bin directory with a different server.xml file.

The downside is that I have two instances of Tomcat running, which was
precisely what I intended to avoid.

A minor annoyance is that it insists in creating folders with "8080" in the
name under the work directory. I suppose (but haven't trashed a Tomcat
server trying this) that it would create some very nasty side-effects when
you forget to set a new work directory and have contexts named equaly on
your different applications.

You can't always win...

Please, tomcat dev list, find a way to have more than one server tag on
server.xml... If not now, maybe on Catalina.

-----Original Message-----
From: Ricardo Bánffy [mailto:ricardo@organic.com.br]
Sent: Wednesday, May 24, 2000 11:53 AM
To: tomcat-user@jakarta.apache.org
Subject: RE: Multiple homes


BTW, I just tried (I think I have tried that before, but this time I can
show more info) adding another context manager.

When I tried to add the context manager (listed below)

    <ContextManager debug="1" workDir="my_other_root_work" >
        <!-- ContextInterceptor
className="org.apache.tomcat.context.LogEvents" / -->
        <ContextInterceptor className="org.apache.tomcat.context.AutoSetup"
/>
        <ContextInterceptor
className="org.apache.tomcat.context.DefaultCMSetter" />
        <ContextInterceptor
className="org.apache.tomcat.context.WorkDirInterceptor" />
        <ContextInterceptor
className="org.apache.tomcat.context.WebXmlReader" />
        <ContextInterceptor
className="org.apache.tomcat.context.LoadOnStartupInterceptor" />
        <!-- Request processing -->
        <RequestInterceptor
className="org.apache.tomcat.request.SimpleMapper" debug="0" />
        <RequestInterceptor
className="org.apache.tomcat.request.SessionInterceptor" />
        <RequestInterceptor
className="org.apache.tomcat.request.SecurityCheck" />
        <RequestInterceptor className="org.apache.tomcat.request.FixHeaders"
/>

        <Connector className="org.apache.tomcat.service.SimpleTcpConnector">
            <Parameter name="handler"
value="org.apache.tomcat.service.http.HttpConnectionHandler"/>
            <Parameter name="port" value="8091"/>
        </Connector>

        <Connector className="org.apache.tomcat.service.SimpleTcpConnector">
            <Parameter name="handler"
value="org.apache.tomcat.service.connector.Ajp12ConnectionHandler"/>
            <Parameter name="port" value="8009"/>
        </Connector>

        <!-- example - how to override AutoSetup actions -->
        <Context path="/" docBase="webapps/my_other_root" debug="0"
reloadable="true" >
        </Context>
    </ContextManager>

to the single server, I got this (ugly) trace

D:\jakarta-tomcat\bin>startup
Starting tomcat in new window
Using classpath:
..\classes;..\lib\webserver.jar;..\lib\jasper.jar;..\lib\xml.ja
r;..\lib\servlet.jar;d:\jdk1.3\lib\tools.jar
Context log: path="/examples" Adding context path="/examples"
docBase="webapps/
examples"
Context log: path="" Adding context path=""  docBase="webapps/ROOT"
Context log: path="/test" Adding context path="/test"
docBase="webapps/test"
Setting level to 1
set work dir my_other_root_work
Add contextInterceptor javaClass="org.apache.tomcat.context.AutoSetup"
Add contextInterceptor javaClass="org.apache.tomcat.context.DefaultCMSetter"
Add contextInterceptor
javaClass="org.apache.tomcat.context.WorkDirInterceptor"

Add contextInterceptor javaClass="org.apache.tomcat.context.WebXmlReader"
Add contextInterceptor
javaClass="org.apache.tomcat.context.LoadOnStartupInterceptor"
Add requestInterceptor javaClass="org.apache.tomcat.request.SimpleMapper"
Add requestInterceptor
javaClass="org.apache.tomcat.request.SessionInterceptor"

Add requestInterceptor javaClass="org.apache.tomcat.request.SecurityCheck"
Add requestInterceptor javaClass="org.apache.tomcat.request.FixHeaders"
Add connector javaClass="org.apache.tomcat.service.SimpleTcpConnector"
Add connector javaClass="org.apache.tomcat.service.SimpleTcpConnector"
Warning: replacing context for
Removing context path=""
ERROR reading ..\conf\server.xml
At Line 99 /Server/ContextManager/Context/

FATAL: configuration error
java.lang.reflect.InvocationTargetException: java.lang.NullPointerException
        at
org.apache.tomcat.request.SessionInterceptor.contextShutdown(SessionIntercep
tor.java:213)
        at
org.apache.tomcat.core.ContextManager.shutdownContext(ContextManager.java:24
4)
        at
org.apache.tomcat.core.ContextManager.removeContext(ContextManager.java:322)
        at
org.apache.tomcat.core.ContextManager.addContext(ContextManager.java:294)
        at java.lang.reflect.Method.invoke(Native Method)
        at org.apache.tomcat.util.xml.AddChild.end(XmlMapper.java:639)
        at org.apache.tomcat.util.xml.XmlMapper.matchEnd(XmlMapper.java:321)
        at
org.apache.tomcat.util.xml.XmlMapper.endElement(XmlMapper.java:96)
        at com.sun.xml.parser.Parser.maybeElement(Parser.java:1412)
        at com.sun.xml.parser.Parser.content(Parser.java:1498)
        at com.sun.xml.parser.Parser.maybeElement(Parser.java:1399)
        at com.sun.xml.parser.Parser.content(Parser.java:1498)
        at com.sun.xml.parser.Parser.maybeElement(Parser.java:1399)
        at com.sun.xml.parser.Parser.parseInternal(Parser.java:491)
        at com.sun.xml.parser.Parser.parse(Parser.java:283)
        at org.apache.tomcat.util.xml.XmlMapper.readXml(XmlMapper.java:198)
        at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:143)
        at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:163)
D:\jakarta-tomcat\bin>

Help, anyone?

-----Original Message-----
From: kc.baltz [mailto:kc.baltz@inforonics.com]
Sent: Wednesday, May 24, 2000 9:35 AM
To: 'tomcat-user@jakarta.apache.org'
Subject: RE: Multiple homes


*sheepish* yes I did copy the entire tree.  It seemed like the easiest thing
to do and disk space isn't a problem.  I'm sure this wasn't necessary
though.  I'm sure you could symlink all but the conf directory.

K.C.


--------------------------------------------------------------------------
To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
For additional commmands, email: tomcat-user-help@jakarta.apache.org


Mime
View raw message