From 28cbed41442ed567d8104cbeabe5ae29dddddc35 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Wed, 26 Aug 2009 09:15:11 +0000 Subject: [PATCH] JETTY-838 Dont log and throw git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@766 7e9141cc-0065-0410-87d8-b60c137991c4 --- VERSION.txt | 1 + .../eclipse/jetty/server/AbstractConnector.java | 1 - .../jetty/server/handler/ContextHandler.java | 3 ++- .../server/handler/ContextHandlerCollection.java | 2 +- .../jetty/server/handler/ResourceHandler.java | 3 ++- .../jetty/server/ssl/SslSocketConnector.java | 5 +++-- .../java/org/eclipse/jetty/servlet/Holder.java | 3 ++- .../jetty/util/component/AbstractLifeCycle.java | 16 +++++++--------- .../jetty/webapp/WebXmlConfiguration.java | 9 --------- 9 files changed, 18 insertions(+), 25 deletions(-) diff --git a/VERSION.txt b/VERSION.txt index e0082448627..7f5a20766c1 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1,5 +1,6 @@ jetty-7.0.0-SNAPSHOT + 286911 Clean out cache when recycling HTTP fields + + JETTY-838 Don't log and throw + JETTY-874 Better header full warnings + JETTY-960 Support for ldaps + JETTY-1081 Handle null content type in GzipFilter diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java index a6bc2e10998..779832998f6 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java @@ -755,7 +755,6 @@ public abstract class AbstractConnector extends HttpBuffers implements Connector } catch(ThreadDeath e) { - Log.warn(e); throw e; } catch(Throwable e) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java index 91d095c7357..1753cd7896c 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandler.java @@ -1169,7 +1169,8 @@ public class ContextHandler extends ScopedHandler implements Attributes, Server. } catch (Exception e) { - Log.warn(e); + Log.warn(e.toString()); + Log.debug(e); throw new IllegalArgumentException(resourceBase); } } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandlerCollection.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandlerCollection.java index cb722cc8301..0348f66be31 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandlerCollection.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandlerCollection.java @@ -279,7 +279,7 @@ public class ContextHandlerCollection extends HandlerCollection } catch (Exception e) { - Log.warn(e); + Log.debug(e); throw new Error(e); } } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ResourceHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ResourceHandler.java index 51792da9dd2..66af4834f20 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ResourceHandler.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ResourceHandler.java @@ -177,7 +177,8 @@ public class ResourceHandler extends AbstractHandler } catch (Exception e) { - Log.warn(e); + Log.warn(e.toString()); + Log.debug(e); throw new IllegalArgumentException(resourceBase); } } diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/ssl/SslSocketConnector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/ssl/SslSocketConnector.java index 58a7e2c343f..90d6daf23ea 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/ssl/SslSocketConnector.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/ssl/SslSocketConnector.java @@ -472,8 +472,9 @@ public class SslSocketConnector extends SocketConnector implements SslConnector } catch (Exception e) { - Log.warn(Log.EXCEPTION, e); - throw new IOException("Could not create JsseListener: " + e.toString()); + Log.warn(e.toString()); + Log.debug(e); + throw new IOException("!JsseListener: " + e); } return socket; } diff --git a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/Holder.java b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/Holder.java index 5bc78033ffa..cf3fd7ad60c 100644 --- a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/Holder.java +++ b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/Holder.java @@ -77,7 +77,8 @@ public class Holder extends AbstractLifeCycle } catch (Exception e) { - Log.warn(e); + Log.warn(e.toString()); + Log.debug(e); throw new UnavailableException(e.getMessage(), -1); } } diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/component/AbstractLifeCycle.java b/jetty-util/src/main/java/org/eclipse/jetty/util/component/AbstractLifeCycle.java index 38a89d536e1..e6c07eb6695 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/component/AbstractLifeCycle.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/component/AbstractLifeCycle.java @@ -51,21 +51,17 @@ public abstract class AbstractLifeCycle implements LifeCycle { if (_state == __STARTED || _state == __STARTING) return; - Log.debug("Starting {}",this); setStarting(); doStart(); - Log.debug(STARTED+" {}",this); setStarted(); } catch (Exception e) { - Log.debug(FAILED+" " + this,e); setFailed(e); throw e; } catch (Error e) { - Log.debug(FAILED+" " + this,e); setFailed(e); throw e; } @@ -82,18 +78,15 @@ public abstract class AbstractLifeCycle implements LifeCycle return; setStopping(); doStop(); - Log.debug(STOPPED+" {}",this); setStopped(); } catch (Exception e) { - Log.debug(FAILED+" " + this,e); setFailed(e); throw e; } catch (Error e) { - Log.debug(FAILED+" " + this,e); setFailed(e); throw e; } @@ -155,6 +148,7 @@ public abstract class AbstractLifeCycle implements LifeCycle private void setStarted() { + Log.debug(STARTED+" {}",this); _state = __STARTED; if (_listeners != null) { @@ -167,6 +161,7 @@ public abstract class AbstractLifeCycle implements LifeCycle private void setStarting() { + Log.debug("Starting {}",this); _state = __STARTING; if (_listeners != null) { @@ -191,6 +186,7 @@ public abstract class AbstractLifeCycle implements LifeCycle private void setStopped() { + Log.debug(STOPPED+" {}",this); _state = __STOPPED; if (_listeners != null) { @@ -201,14 +197,16 @@ public abstract class AbstractLifeCycle implements LifeCycle } } - private void setFailed(Throwable error) + private void setFailed(Throwable th) { + Log.warn(FAILED+" " + this+": "+th); + Log.debug(th); _state = __FAILED; if (_listeners != null) { for (int i = 0; i < _listeners.length; i++) { - _listeners[i].lifeCycleFailure(this,error); + _listeners[i].lifeCycleFailure(this,th); } } } diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebXmlConfiguration.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebXmlConfiguration.java index da33f6f05f3..de908ddb06a 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebXmlConfiguration.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebXmlConfiguration.java @@ -29,14 +29,10 @@ import org.eclipse.jetty.util.resource.Resource; /** * Configure by parsing default web.xml and web.xml * - * */ public class WebXmlConfiguration implements Configuration { - - - /* ------------------------------------------------------------------------------- */ /** * Process webdefaults.xml @@ -86,7 +82,6 @@ public class WebXmlConfiguration implements Configuration /** * Process web.xml, web-fragment.xml(s), override-web.xml * - * */ public void configure (WebAppContext context) throws Exception { @@ -106,7 +101,6 @@ public class WebXmlConfiguration implements Configuration //process web.xml (the effective web.xml???) processor.processWebXml(); - //process override-web.xml String overrideDescriptor = context.getOverrideDescriptor(); @@ -119,7 +113,6 @@ public class WebXmlConfiguration implements Configuration processor.processOverride(); } } - public void postConfigure(WebAppContext context) throws Exception { @@ -129,8 +122,6 @@ public class WebXmlConfiguration implements Configuration context.setAttribute(WebXmlProcessor.WEBXML_CLASSNAMES, null); } - - /* ------------------------------------------------------------------------------- */ protected Resource findWebXml(WebAppContext context) throws IOException, MalformedURLException {