aspose file tools*
The moose likes Tomcat and the fly likes How to configure context.xml in tomcat/config Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "How to configure context.xml in tomcat/config" Watch "How to configure context.xml in tomcat/config" New topic
Author

How to configure context.xml in tomcat/config

Vishnu Prakash
Ranch Hand

Joined: Nov 15, 2004
Posts: 1026
I am using Tomcat 5.5.9

To get this code working in servlet for cross-context communication

ServletContext currentContext = getServletContext();
ServletContext futureContext = currentContext.getContext("/TestOne");

am supposed to make certain configuration changes in tomcat
Refer: http://tomcat.apache.org/tomcat-5.5-doc/config/context.html

And this is what I did in context.xml

<Context path="/SessionExample" docBase="E:\tomcat\webapps\SessionExample"
crossContext="true" debug="0" reloadable="true" privileged="true">
<WatchedResource>WEB-INF/web.xml</WatchedResource>
</Context>

<Context path="/TestOne" docBase="E:\tomcat\webapps\TestOne"
crossContext="true" debug="0" reloadable="true" privileged="true">
<WatchedResource>WEB-INF/web.xml</WatchedResource>
</Context>


where SessionExample is current context and TestOne is my second context.

But I am getting error when I startup tomcat server.

SEVERE: Parse error in default web.xml
org.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed.


Servlet Spec 2.4/ Jsp Spec 2.0/ JSTL Spec 1.1 - JSTL Tag Documentation
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12821
    
    5
SEVERE: Parse error in default web.xml
org.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed.

So you have badly formed XML in your default web.xml
Have you made any changes to the web.xml file that lives in CATALINA_HOME/conf?
Vishnu Prakash
Ranch Hand

Joined: Nov 15, 2004
Posts: 1026
No I didn't touch any thing other than context.xml in tomcat/config
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to configure context.xml in tomcat/config