From 8bfb3649ddf7dfa8adffaea583ecfee2ee9e7df3 Mon Sep 17 00:00:00 2001 From: zzz Date: Tue, 28 Feb 2017 03:52:32 +0000 Subject: [PATCH] Fix webapps and plugins not starting, because the default configurations were not being run. Revert adding JettyJspServlet class, maybe we don't need it after all. --- apps/jetty/build.xml | 2 ++ .../java/src/net/i2p/router/web/WebAppStarter.java | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/apps/jetty/build.xml b/apps/jetty/build.xml index 9c8544d70..7dfe415f5 100644 --- a/apps/jetty/build.xml +++ b/apps/jetty/build.xml @@ -174,7 +174,9 @@ + diff --git a/apps/routerconsole/java/src/net/i2p/router/web/WebAppStarter.java b/apps/routerconsole/java/src/net/i2p/router/web/WebAppStarter.java index 4455945e8..42424c9b8 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/WebAppStarter.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/WebAppStarter.java @@ -112,6 +112,13 @@ public class WebAppStarter { // see WebAppConfiguration for info String[] classNames = wac.getConfigurationClasses(); + // In Jetty 9, it doesn't set the defaults if we've already added one, but the + // defaults aren't set yet when we call the above. So we have to get the defaults. + // Without the default configuration, the web.xml isn't read, and the webapp + // won't respond to any requests, even though it appears to be running. + // See WebAppContext.loadConfigurations() in source + if (classNames.length == 0) + classNames = wac.getDefaultConfigurationClasses(); String[] newClassNames = new String[classNames.length + 1]; for (int j = 0; j < classNames.length; j++) newClassNames[j] = classNames[j];