Summary: | Cannot undeploy/deploy misconfigured app after tomcat startup | ||
---|---|---|---|
Product: | Tomcat 5 | Reporter: | Gabriele Garuglieri <gabriele.garuglieri> |
Component: | Catalina | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | Unknown | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Attachments: | HostConfig patch |
Description
Gabriele Garuglieri
2004-12-20 11:23:04 UTC
I don't find you convincing at all this time, sorry. Remy, i'm not trying to convince anybody. I'm just reporting what is happening. I mean, Bug 32729 is solved. This is all new. I can deploy a misconfigured app and then i can undeploy it, but if i stop tomcat after deploying a misconfigured app, at restart happens what reported above. There is obviously the possibility that i'm doing something really stupid, but pls don't trash this before giving it a look. Thanks, Gabriele. I misread the bug report, and I will not fix this, sorry. Avoid screwing up context.xml (and same with server.xml). Alternately, you can try to provide a patch if you feel you can fix it. Please do not reopen the bug report. Well, Remy, just out of curiosity, when you consider a bug a bug? ;)
> Avoid screwing up context.xml (and same with server.xml).
In a perfect world i'd agree with you, but in a large company where, who's
operating (and sometimes configuring) the application servers are not the same
people who wrote the apps, to paraphrase a famous movie, "I've seen things, you
humans can't even imagine...":)
Anyhow, i tried to look into the source and i saw that the problem is that the
app gets registered in the deployed Map when indeed the Context has not been
built and there's no child with that name added to the host container.
This makes the app no longer neither deployable nor undeployable and makes
Tomcat behaving erratically at stop time.
If i didn't overlook something, in org.apache.catalina.startup.HostConfig should
be enough to check if the digester correctly built the Context and if has been
added as a child to the host container before registering it into the deployed Map.
In this case, the war deployer will have a chance later to try to deploy the app
war, but since the context.xml is screwed up, the app will be registered but
will remain stopped.
This will allow to undeploy and redeploy it without problems.
Obviously this will cause the context.xml to be parsed twice, and the log will
show twice the SAXException messages, but i don't think this should be a
problem, because now it is a recoverable and controlled situation.
I'll attach a patch for this.
Created attachment 13820 [details]
HostConfig patch
Here's the patch that "should" solve what described above.
I have applied your patch, thanks. |