atom feed10 messages in org.apache.tomcat.usersRe: Web.xml mistake results in <Conte...
FromSent OnAttachments
Kevin ConawayFeb 5, 2003 2:59 pm 
Will HartungFeb 5, 2003 3:37 pm 
Sean DockeryFeb 5, 2003 3:38 pm 
Kevin ConawayFeb 5, 2003 3:39 pm 
Sean DockeryFeb 5, 2003 4:18 pm 
Shapira, YoavFeb 6, 2003 6:25 am 
Kevin ConawayFeb 6, 2003 2:56 pm 
Craig R. McClanahanFeb 6, 2003 3:08 pm 
Sean DockeryFeb 6, 2003 3:32 pm 
Craig R. McClanahanFeb 6, 2003 3:46 pm 
Subject:Re: Web.xml mistake results in <Context> unavailable !?
From:Craig R. McClanahan (crai@apache.org)
Date:Feb 6, 2003 3:08:29 pm
List:org.apache.tomcat.users

On Thu, 6 Feb 2003, Kevin Conaway wrote:

Date: Thu, 6 Feb 2003 17:56:28 -0500 From: Kevin Conaway <kcon@ucwphilly.rr.com> Reply-To: Tomcat Users List <tomc@jakarta.apache.org> To: Tomcat Users List <tomc@jakarta.apache.org> Subject: Re: Web.xml mistake results in <Context> unavailable !?

This isnt a production environment, it is an educational environment at a university. Students who are learning are guaranteed to make mistakes, even in their web.xml file. I tested an experiment, it takes roughly 7 seconds between the time you save your web.xml file and the time tomcat reloads it. Every time a student makes a mistake, they shouldnt have to run to the prof who in turn runs to the admin to restart the server or use the manager app.

Seven seconds sounds like a statistically valid number, given that Tomcat checks every 15 seconds for updated files. If you measured for a while longer, I'll bet the average would actually be closer to 7.5 seconds if it's truly a random distribution :-).

Enabling your students to issue a "reload" command on demand, via the manager webapp, would allow the turnaround time to be much faster -- indeed, I build that directly into my Ant build.xml files, so I can simply say

ant reload

which recompiles the app (because I made the "reload" target depend on the "compile" traget), and tells Tomcat to reload it, in one step.

Kevin

Craig

----- Original Message ----- From: "Shapira, Yoav" <Yoav@mpi.com> To: "Tomcat Users List" <tomc@jakarta.apache.org> Sent: Thursday, February 06, 2003 9:26 AM Subject: RE: Web.xml mistake results in <Context> unavailable !?

Howdy, Someone else already suggested workarounds. Just thought I'd chime in with my 2 cents (US): you're on a wrong track. It is your responsibility (or the responsibility of whoever packages your application for deployment) to get the web.xml file correct. It has a clearly defined DTD.

I don't think tomcat should try to be lenient of errors in this file at all. It gives you the line number and column where the error occurs, with a (usually) descriptive message. IMHO, that's perfect behavior on the server's part.

Fix it and restart the server. If you have the manager app enabled, fix it and you don't even have to restart the server, just reload your app.

Usually, the web.xml should have been validated in a testing environment long before shipping to production.

To each their own, I realize, but as I mentioned above, just my .02USD

Yoav Shapira Millennium ChemInformatics

-----Original Message----- From: Kevin Conaway [mailto:kcon@ucwphilly.rr.com] Sent: Wednesday, February 05, 2003 6:40 PM To: Tomcat Users List Subject: Re: Web.xml mistake results in <Context> unavailable !?

That is assuming the manager application is enabled. I was hoping for more of an internal solution that Tomcat can do itself. This is being used in an educational environment and everytime a student blows up his context, he/she shouldnt have to run to the prof to reload the application...

Kevin

----- Original Message ----- From: "Sean Dockery" <se@sbdconsultants.com> To: "Tomcat Users List" <tomc@jakarta.apache.org> Sent: Wednesday, February 05, 2003 6:38 PM Subject: Re: Web.xml mistake results in <Context> unavailable !?

One of the following should work...

http://localhost:8080/manager/html/start?path=/yourwebapp

or

http://localhost:8080/manager/html/reload?path=/yourwebapp

This will prompt the Tomcat manager application to either start or reload your application.

At 17:59 2003-02-05 -0500, you wrote:

In Tomcat 4.1.18, i have several different contexts each with a corresponding WEB-INF hierarchy and web.xml. Now, if I make a mistake in the web.xml like i forget to end a </servlet> tag, it says that

there is

a

parse error and then "Marking this application unavailable due to previous error(s)" and I cannot use the context ever again until the server restarts. How can i fix this so the context gets checkd again at

some

point?

Kevin