This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Tomcat and the fly likes context configuration Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "context configuration" Watch "context configuration" New topic

context configuration

Jan Groth
Ranch Hand

Joined: Feb 03, 2004
Posts: 456
Hello there,

i'm experiencing inconsistencies in tomcat configuration. it seems that some of my changes are evaluated just sometimes, while others seem to work fine.

i am working with tomcat 5.5.17 on windows xp. to avoid side effects with auto-loading, i restart tomcat every single time i make a config change.

according to the context documentation, tomcat has a certain evaluation order. that's how i understand it

(1) try to read a context from cat_hom/conf/server.xml (discouraged...)
(2) cat_hom/conf/context.xml (empty for me)
(3) cat_hom/conf/engine/host/context.xml.default (not existing for me)
(4) cat_hom/conf/engine/host/webapp.xml (not existing for me)
(5) (if 4 was not found) /META-INF/context.xml (that's where i try to make my config)

to make a long story (and a long night) short:

changes in (1) are evaluated immediately, all others are more or less ignored.

i'm trying to set docBase / path, to achieve absolut referencing to ressources (/img/myPic.gif over img/myPic.gif). for example, if i set a non-valid docbase in (1), tomcat starts with a corresponding error. if i delete the docbase config from (1) and put it to (5) nothing happens. furthermore _sometimes_ the adressing works, sometimes not. if i add an xml-error to (5), i get an immediate xml-parse-exception...

as mentioned, i do restart tomcat after every single change. browser cache is deactivated. this drives me crazy.

any ideas?

many thanks,
Jan Groth
Ranch Hand

Joined: Feb 03, 2004
Posts: 456
hello jan,

delete cat_hom/work everytime you make config changes.

many greetings,
It is sorta covered in the JavaRanch Style Guide.
subject: context configuration
Similar Threads
DatasourceRealm just ain't working
Servlet reload Problem
Unable to configure tomcat 6.0 datasource from within eclipse.
What is Tomcat virtual host, What is different from the Apache Tomcat?
static content (css and EXT-JS JavaScript) not found 404 (SOLVED)