• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

How to configure context.xml in tomcat/config

 
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 1026
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No I didn't touch any thing other than context.xml in tomcat/config
 
Never trust an airline that limits their passengers to one carry on iguana. Put this tiny ad in your shoe:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic