tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pid <...@pidster.com>
Subject Re: multiple Context elements in conf/context.xml file
Date Fri, 03 Sep 2010 18:00:36 GMT
On 03/09/2010 18:47, Tom H wrote:
> 
> my existing conf/context.xml file has already a <Context> element;
> <Context>
>    <WatchedResource>WEB-INF/web.xml</WatchedResource>
> </Context>
> 
> 
> I would like to add another to allow access to the /manager/status
> location to my monitoring, however adding a new Context element like so;
> 
> conf/context.xml
> ----
> <Context>
>    <WatchedResource>WEB-INF/web.xml</WatchedResource>
> </Context>
> <Context path="/manager" privileged="true"
>         docBase="/usr/share/tomcat6/webapps/manager">
>         <Valve className="org.apache.catalina.valves.RemoteAddrValve"
>                allow="127\.0\.0\.1"/>
> </Context>
> ----
> 
> 
> breaks the xml, as I presume that file needs a single root element to
> lint/parse ok
> SEVERE: Parse Fatal Error at line 6 column 2: The markup in the document
> following the root element must be well-formed.
> org.xml.sax.SAXParseException: The markup in the document following the
> root element must be well-formed.
>        at
> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)


conf/context.xml is the *default* configuration, which provides a
baseline for other context definitions.  You can't put multiple
definitions in there.

The others are individually placed like so:

 conf/Catalina/localhost/ROOT.xml
 conf/Catalina/localhost/mycontext.xml
 conf/Catalina/localhost/manager.xml
 conf/Catalina/localhost/example-app.xml


p

Mime
View raw message