multiple Context elements in conf/context.xml file

2010-09-03 Thread Tom H


my existing conf/context.xml file has already a Context element;
Context
   WatchedResourceWEB-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
   WatchedResourceWEB-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)


Any suggestions on how to add that?

Thanks,
Tom



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: multiple Context elements in conf/context.xml file

2010-09-03 Thread Pid
On 03/09/2010 18:47, Tom H wrote:
 
 my existing conf/context.xml file has already a Context element;
 Context
WatchedResourceWEB-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
WatchedResourceWEB-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


0x62590808.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature