Summary: | Embeded Tomcat Initialises Context Twice | ||
---|---|---|---|
Product: | Tomcat 5 | Reporter: | Darran Lofthouse <darran> |
Component: | Catalina | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 5.5.9 | ||
Target Milestone: | --- | ||
Hardware: | All | ||
OS: | All | ||
Attachments: | Update to StandardContext to prevent double initialisation. |
Description
Darran Lofthouse
2005-09-24 22:38:53 UTC
Created attachment 16519 [details]
Update to StandardContext to prevent double initialisation.
In 5.5.9, the call to init from addChild only happens if you are deploying the Context into a Host that has already been started. In that case, your patch doesn't do anything useful since the 'initialized' variable still won't be set on the second call to init. Thank you for your comment. The host has already been started by the time the web application is deployed. The getParent method constructed the correct ObjectName for the host and it was found correctly. Yes for the second call initialized will not be set, however the first call will be blocked on the invoke on line 5005. The second call will complete and control will return to the first, initialized will now be true so the initialisation will not happen again (for the first call). Ok, I see now. I was thinking that you were trying to stop init being called twice (which doesn't seem possible with the current JMX-deployment scheme). You're patch is still sending the JMX Notification twice, so by the time you add that, it seemed much simplier to simply do: if( initialized ) { return; } So that is what got committed to the CVS, and will appear in 5.5.13. |