Author: remy.maucherat(a)jboss.com
Date: 2008-09-02 11:42:10 -0400 (Tue, 02 Sep 2008)
New Revision: 763
Modified:
trunk/java/org/apache/catalina/core/StandardContext.java
trunk/java/org/apache/catalina/core/StandardPipeline.java
trunk/webapps/docs/changelog.xml
Log:
- Improve exception handling if an exception occurs starting a component like the loader
(where the context would
remain in a bad state).
- Clear out lifecycle exceptions from StandardPipeline.
Modified: trunk/java/org/apache/catalina/core/StandardContext.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardContext.java 2008-09-01 11:37:39 UTC (rev
762)
+++ trunk/java/org/apache/catalina/core/StandardContext.java 2008-09-02 15:42:10 UTC (rev
763)
@@ -4238,8 +4238,6 @@
// Binding thread
ClassLoader oldCCL = bindThread();
- boolean mainOk = false;
-
try {
if (ok) {
@@ -4294,12 +4292,7 @@
Manager contextManager = null;
if (manager == null) {
if ( (getCluster() != null) && distributable) {
- try {
- contextManager = getCluster().createManager(getName());
- } catch (Exception ex) {
- log.error("standardContext.clusterFail", ex);
- ok = false;
- }
+ contextManager = getCluster().createManager(getName());
} else {
contextManager = new StandardManager();
}
@@ -4316,22 +4309,18 @@
getCluster().registerManager(manager);
}
- mainOk = true;
-
}
+ } catch (Throwable t) {
+ // This can happen in rare cases with custom components
+ ok = false;
+ log.error(sm.getString("standardContext.startFailed", getName()),
t);
} finally {
// Unbinding thread
unbindThread(oldCCL);
- if (!mainOk) {
- // An exception occurred
- // Register with JMX anyway, to allow management
- registerJMX();
- }
}
if (!getConfigured()) {
- log.error( "Error getConfigured");
ok = false;
}
Modified: trunk/java/org/apache/catalina/core/StandardPipeline.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardPipeline.java 2008-09-01 11:37:39 UTC (rev
762)
+++ trunk/java/org/apache/catalina/core/StandardPipeline.java 2008-09-02 15:42:10 UTC (rev
763)
@@ -214,9 +214,11 @@
public synchronized void start() throws LifecycleException {
// Validate and update our current component state
- if (started)
- throw new LifecycleException
- (sm.getString("standardPipeline.alreadyStarted"));
+ if (started) {
+ if(log.isDebugEnabled())
+ log.debug(sm.getString("standardPipeline.alreadyStarted"));
+ return;
+ }
// Notify our interested LifecycleListeners
lifecycle.fireLifecycleEvent(BEFORE_START_EVENT, null);
@@ -253,9 +255,11 @@
public synchronized void stop() throws LifecycleException {
// Validate and update our current component state
- if (!started)
- throw new LifecycleException
- (sm.getString("standardPipeline.notStarted"));
+ if (!started) {
+ if(log.isDebugEnabled())
+ log.debug(sm.getString("standardPipeline.notStarted"));
+ return;
+ }
// Notify our interested LifecycleListeners
lifecycle.fireLifecycleEvent(BEFORE_STOP_EVENT, null);
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2008-09-01 11:37:39 UTC (rev 762)
+++ trunk/webapps/docs/changelog.xml 2008-09-02 15:42:10 UTC (rev 763)
@@ -17,9 +17,17 @@
<body>
<section name="JBoss Web 2.1.1.CR7 (remm)">
- <subsection name="Jasper">
+ <subsection name="Catalina">
<changelog>
<fix>
+ <jboss-jira>JBAS-5917</jboss-jira>: Fix error handling starting one
of the core components,
+ and harmonize lifecycle checks of StandardPipeline zith the other components.
(remm)
+ </fix>
+ </changelog>
+ </subsection>
+ <subsection name="Jasper">
+ <changelog>
+ <fix>
Sync with EL from Tomcat, to fix a number of complex expressions. (remm)
</fix>
<fix>
Show replies by date