markt 2004/12/22 15:28:47
Modified: catalina/src/share/org/apache/catalina/core
ContainerBase.java
Log:
Fix bug 32453. Cross-context calls to getContext can return null during
initialisation.
- Port of Remy's patch to TC5 for same issue.
Revision Changes Path
1.24 +9 -2
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/ContainerBase.java
Index: ContainerBase.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/ContainerBase.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- ContainerBase.java 22 Dec 2004 23:12:50 -0000 1.23
+++ ContainerBase.java 22 Dec 2004 23:28:47 -0000 1.24
@@ -768,16 +768,23 @@
child.getName() +
"' is not unique");
child.setParent((Container) this); // May throw IAE
+ children.put(child.getName(), child);
+
if (started && (child instanceof Lifecycle)) {
+ boolean success = false;
try {
((Lifecycle) child).start();
+ success = true;
} catch (LifecycleException e) {
log("ContainerBase.addChild: start: ", e);
throw new IllegalStateException
("ContainerBase.addChild: start: " + e);
+ } finally {
+ if (!success) {
+ children.remove(child.getName());
+ }
}
}
- children.put(child.getName(), child);
fireContainerEvent(ADD_CHILD_EVENT, child);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]