RE: Problem with default context when moving from 5.5.7 to 5.5.12
> From: Jason Burrows [mailto:[EMAIL PROTECTED] > Subject: Re: Problem with default context when moving from > 5.5.7 to 5.5.12 > > I agree, but the best documentation I could find on this was: > http://tomcat.apache.org/tomcat-5.5-doc/config/context.html > > ...and there's nothing in that document that would lead me to try what > you suggested, even reading now knowing that is the solution. The documentation has not kept up with the implementation. (Haven't yet met a programmer that actually likes to write documentation.) The key piece of hard-to-find information is that the default web app must be specified with the context name (not path) ROOT. > then says "context elements for the default context must go in > your server.xml file" I can't find any place that says that. What it does say is "In addition, you MUST define a Context with a context path equal to a zero-length string." Since zero-length filenames are a bit tricky, the current mechanism uses the name ROOT to create a zero-length context path. > Where are you getting documentation that more accurately explains > the context setup, and led you to the solution you provided? Reading this mailing list carefully, experimenting, and not sleeping much. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with default context when moving from 5.5.7 to 5.5.12
Thanks very much Chuck! That did indeed fix my problem. I have a couple of related questions though... > > > > This worked fine for me in 5.5.7 (on many machines). > > But it shouldn't have. I suspect this was one of the bugs fixed between > .7 and .12, where the documented rules are more tightly enforced. I agree, but the best documentation I could find on this was: http://tomcat.apache.org/tomcat-5.5-doc/config/context.html ...and there's nothing in that document that would lead me to try what you suggested, even reading now knowing that is the solution. In addition, there is that spot (directly quoted in my first email, but I'll paraphrase here) that first says "don't put context elements in your server.xml file" then says "context elements for the default context must go in your server.xml file" and then says "you must provide a default context". I don't see how all three statements can be true, and yet that is all I had to go off of. Where are you getting documentation that more accurately explains the context setup, and led you to the solution you provided? Thanks! Jason - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem with default context when moving from 5.5.7 to 5.5.12
> From: Jason Burrows [mailto:[EMAIL PROTECTED] > Subject: Problem with default context when moving from 5.5.7 to 5.5.12 > > Previously, I had a context.xml file in my tomcat\conf directory with > this context tag (removed sub elements for brevity): > > crossContext="true"> > > > This worked fine for me in 5.5.7 (on many machines). But it shouldn't have. I suspect this was one of the bugs fixed between .7 and .12, where the documented rules are more tightly enforced. > After installing 5.5.12, I see there is a context element in this file > already. As I understand it, the conf/context.xml provides global settings applicable to all webapps; it is not there to define a context for any particular webapp, just extend the context for each. > How do I set up a default context in 5.5.12 for a web application that > is not located in the web apps directory (I could do this for 5.5.7 > and before using the method described above). Rename your context.xml file to ROOT.xml (case sensitive) and put it in conf/Catalina/localhost (assuming that's the only you have defined). Remove the path attribute if it's still in there. Include a docBase attribute that specifies the location of your webapp (you probably already have that). Delete the webapps/ROOT directory. Restart Tomcat. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem with default context when moving from 5.5.7 to 5.5.12
Hi all - I have recently upgraded from Tomcat 5.5.7 to 5.5.12 and now I am having problems getting my default context to work correctly. I very well may have been doing this incorrectly the first time, but I still need to figure out how to get it working again. In this specific case, I am trying to get Tomcat to use an external directory for the docBase for development purposes, and as I say, it was working correctly before. For the moment, I have no other webapps installed at all. Previously, I had a context.xml file in my tomcat\conf directory with this context tag (removed sub elements for brevity): This worked fine for me in 5.5.7 (on many machines). After installing 5.5.12, I see there is a context element in this file already. If I replace it with mine, it changes nothing (Tomcat starts and loads no webapps). If I add mine to the file, it also changes nothing. I can in fact add garbage or poorly formed XML to this file and Tomcat will start up correctly, loading no web apps, reporting no errors. No matter what I do to this file, Tomcat loads, but does not load my application. If I take my old context.xml file and move it to tomcat\conf\Catalina\localhost, then it will load my application (I can tell from log output, but I cannot access the servlets at all). This also causes the context.xml file in tomcat\conf to be loaded as well, and if I have errors there they will be reported. I should also mention that in all of these cases (if my app is loading or not loading) when I point my web browser at http://localhost I get a blank page with no content. I get the same result no matter what I put there, even things I'd expect an error for like http://localhost/test/blablabla/asfdd.html. Tomcat doesn't even generate errors about these attempts in the logs, it just reports that everything started up correctly, the server is running, and that's the last I hear from it. So this tells me this: 5.5.7 would read tomcat\conf\context.xml all the time, but 5.5.12 will only read it if you have a context file for your specific host (I imagine it would also read this file if you had a webapp in the webapps folder as well, but I don't). In the change logs from 5.5.7 to 5.5.12, the only references I can see related to the context.xml file are: -Harmonize processing of the context.xml defaults with the way web.xml is processed (remm) -context.xml should be a redeploy resource, and add prioritization for redeploy resources. (remm) These don't seem to be related to my situation. In further reading the Tomcat documentation, I find (http://tomcat.apache.org/tomcat-5.5-doc/config/context.html): "Please note that for tomcat 5, unlike tomcat 4.x, it is NOT recommended to place elements directly in the server.xml file." Then later it says: "If you specify a context path of an empty string (""), you are defining the default web application for this Host, which will process all requests not assigned to other Contexts. The value of this field must not be set except when statically defining a Context in server.xml, as it will be infered from the filenames used for either the .xml context file or the docBase." ...and it also says: "In addition, you MUST define a Context with a context path equal to a zero-length string." So I'm not sure what the correct thing to do is. I am told NOT to put context elements in the server.xml file, then I am told that I should define contexts with an empty string in the server.xml file, and then I am told that I must define a context with a zero-length string. This information is contradictory, so I'm not sure what the correct course of action is. So, to sum it up: How do I set up a default context in 5.5.12 for a web application that is not located in the web apps directory (I could do this for 5.5.7 and before using the method described above). Thanks for any help you can offer. Jason - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]