diff --git a/VERSION.txt b/VERSION.txt index f9d5d7c8678..83aceb72ca3 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1,4 +1,5 @@ jetty-7.4.1-SNAPSHOT + + JETTY-954 WebAppContext eats any start exceptions instead of stopping the server load + 343083 Set nested dispatch type and connection + 343277 add support for a context white list + 343352 make sure that jetty.osgi.boot is activated when a WAB is registered diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/Server.java b/jetty-server/src/main/java/org/eclipse/jetty/server/Server.java index 9bf0eb234a2..adee6829f3e 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/Server.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/Server.java @@ -233,7 +233,9 @@ public class Server extends HandlerWrapper implements Attributes { _dumpBeforeStop = dumpBeforeStop; } - + + + /* ------------------------------------------------------------ */ @Override protected void doStart() throws Exception @@ -254,7 +256,7 @@ public class Server extends HandlerWrapper implements Attributes } catch(Throwable e) { - Log.warn("Error starting handlers",e); + mex.add(e); } if (_connectors!=null) diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebAppContext.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebAppContext.java index c4e2f9d5feb..e5cbf7c037a 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebAppContext.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebAppContext.java @@ -143,6 +143,7 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL private boolean _configurationClassesSet=false; private boolean _configurationsSet=false; private boolean _allowDuplicateFragmentNames = false; + private boolean _throwUnavailableOnStartupException = false; private MetaData _metadata=new MetaData(); @@ -448,6 +449,8 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL Log.warn("Failed startup of context "+this, e); _unavailableException=e; setAvailable(false); + if (isThrowUnavailableOnStartupException()) + throw e; } } @@ -1161,6 +1164,17 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL _allowDuplicateFragmentNames = allowDuplicateFragmentNames; } + + /* ------------------------------------------------------------ */ + public void setThrowUnavailableOnStartupException (boolean throwIfStartupException) { + _throwUnavailableOnStartupException = throwIfStartupException; + } + + + public boolean isThrowUnavailableOnStartupException () { + return _throwUnavailableOnStartupException; + } + /* ------------------------------------------------------------ */ @Override