remm 01/09/05 21:00:16
Modified: catalina/src/share/org/apache/catalina/core
StandardContext.java
Log:
- Not syncing on start / stop / reload is extremely risky, and doesn't bring
anything useful in terms of performance. This patch adds synchronization.
- This fixes some very serious CL issues when hammering the manager
servlet with start / stop requests using more than one connection.
Tested with the examples webapp. Before the fix : NoClassDefFound for classs
javax.servlet.ServletContextEvent thrown on line 160 of listeners.ContextListeners,
after which point the context is dead and can't be stopped / started anymore.
This patch fixes this, and probably many other similar random errors when starting
/
stopping / reloading.
- I couldn't reproduce bug 3336, but this may fix it.
Revision Changes Path
1.76 +7 -7
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContext.java
Index: StandardContext.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -r1.75 -r1.76
--- StandardContext.java 2001/09/04 18:15:30 1.75
+++ StandardContext.java 2001/09/06 04:00:16 1.76
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
1.75 2001/09/04 18:15:30 craigmcc Exp $
- * $Revision: 1.75 $
- * $Date: 2001/09/04 18:15:30 $
+ * $Header:
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
1.76 2001/09/06 04:00:16 remm Exp $
+ * $Revision: 1.76 $
+ * $Date: 2001/09/06 04:00:16 $
*
* ====================================================================
*
@@ -142,7 +142,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
- * @version $Revision: 1.75 $ $Date: 2001/09/04 18:15:30 $
+ * @version $Revision: 1.76 $ $Date: 2001/09/06 04:00:16 $
*/
public class StandardContext
@@ -2370,7 +2370,7 @@
* @exception IllegalStateException if the <code>reloadable</code>
* property is set to <code>false</code>.
*/
- public void reload() {
+ public synchronized void reload() {
// Make sure reloading is enabled
// if (!reloadable)
@@ -3298,7 +3298,7 @@
*
* @exception LifecycleException if a startup error occurs
*/
- public void start() throws LifecycleException {
+ public synchronized void start() throws LifecycleException {
if (debug >= 1)
log("Starting");
@@ -3411,7 +3411,7 @@
*
* @exception LifecycleException if a shutdown error occurs
*/
- public void stop() throws LifecycleException {
+ public synchronized void stop() throws LifecycleException {
if (debug >= 1)
log("Stopping");