From 72d8b133e1b2557e49327432c6155ddb88aa800e Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Wed, 14 Nov 2018 16:46:04 -0800 Subject: [PATCH] Fix running Gerrit on Tomcat - WebAppInitializer moved to another package, fix that in web.xml - fix Guice bindings in WebAppInitializer Bug: Issue 10033 Change-Id: I2fafdd318f789db39b9c4a10bb3261efde30066c --- java/com/google/gerrit/httpd/init/WebAppInitializer.java | 4 ++++ webapp/WEB-INF/web.xml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/java/com/google/gerrit/httpd/init/WebAppInitializer.java b/java/com/google/gerrit/httpd/init/WebAppInitializer.java index 75858dea73..624b307e32 100644 --- a/java/com/google/gerrit/httpd/init/WebAppInitializer.java +++ b/java/com/google/gerrit/httpd/init/WebAppInitializer.java @@ -48,6 +48,7 @@ import com.google.gerrit.server.StartupChecks; import com.google.gerrit.server.account.AccountDeactivator; import com.google.gerrit.server.account.InternalAccountDirectory; import com.google.gerrit.server.api.GerritApiModule; +import com.google.gerrit.server.api.PluginApiModule; import com.google.gerrit.server.audit.AuditModule; import com.google.gerrit.server.cache.h2.H2CacheModule; import com.google.gerrit.server.cache.mem.DefaultMemoryCacheModule; @@ -60,6 +61,7 @@ import com.google.gerrit.server.config.DownloadConfig; import com.google.gerrit.server.config.GerritGlobalModule; import com.google.gerrit.server.config.GerritInstanceNameModule; import com.google.gerrit.server.config.GerritOptions; +import com.google.gerrit.server.config.GerritRuntime; import com.google.gerrit.server.config.GerritServerConfig; import com.google.gerrit.server.config.GerritServerConfigModule; import com.google.gerrit.server.config.SitePath; @@ -326,6 +328,7 @@ public class WebAppInitializer extends GuiceServletContextListener implements Fi modules.add(new MimeUtil2Module()); modules.add(cfgInjector.getInstance(GerritGlobalModule.class)); modules.add(new GerritApiModule()); + modules.add(new PluginApiModule()); modules.add(new SearchingChangeCacheImpl.Module()); modules.add(new InternalAccountDirectory.Module()); modules.add(new DefaultPermissionBackendModule()); @@ -375,6 +378,7 @@ public class WebAppInitializer extends GuiceServletContextListener implements Fi @Override protected void configure() { bind(GerritOptions.class).toInstance(new GerritOptions(config, false, false, false)); + bind(GerritRuntime.class).toInstance(GerritRuntime.DAEMON); } }); modules.add(new GarbageCollectionModule()); diff --git a/webapp/WEB-INF/web.xml b/webapp/WEB-INF/web.xml index 386eb07573..e901357f62 100644 --- a/webapp/WEB-INF/web.xml +++ b/webapp/WEB-INF/web.xml @@ -8,7 +8,7 @@ guiceFilter - com.google.gerrit.httpd.WebAppInitializer + com.google.gerrit.httpd.init.WebAppInitializer guiceFilter