Gerrit 2.13.1 fails to start in Tomcat 8.5.4

430 views
Skip to first unread message

Wulf C. Krueger

unread,
Oct 2, 2016, 6:21:48 AM10/2/16
to repo-d...@googlegroups.com

Hello,

I've tried updating from Gerrit 2.12.3 to 2.13.1 but now Gerrit fails to
start inside its (so far perfectly working) Tomcat:


02-Oct-2016 12:16:57.069 SEVERE [localhost-startStop-1]
org.apache.catalina.core.StandardContext.filterStart Exception starting
filter guiceFilter
com.google.inject.CreationException: Unable to create injector, see the
following errors:


1) No implementation for
com.google.gerrit.server.notedb.NotesMigration was bound.
while locating com.google.gerrit.server.notedb.NotesMigration

for the 2nd parameter of
com.google.gerrit.server.schema.NotesMigrationSchemaFactory.<init>(NotesMigrationSchemaFactory.java:33)
at
com.google.gerrit.server.schema.DatabaseModule.configure(DatabaseModule.java:35)



1 error
at
com.google.gerrit.httpd.WebAppInitializer.init(WebAppInitializer.java:173)

at
com.google.gerrit.httpd.WebAppInitializer.getInjector(WebAppInitializer.java:398)

at
com.google.inject.servlet.GuiceServletContextListener.contextInitialized(GuiceServletContextListener.java:47)
at
com.google.gerrit.httpd.WebAppInitializer.init(WebAppInitializer.java:405)

at
org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
at
org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
at
org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
at
org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4561)

at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5204)

at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152)

at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:724)

at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700)

at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)

at
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:952)
at
org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1823)

at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)

at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

at java.lang.Thread.run(Thread.java:745)



02-Oct-2016 12:17:14.601 INFO
[localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log
ContextListener: contextInitialized()
02-Oct-2016 12:17:14.601 INFO [localhost-startStop-1]
org.apache.catalina.core.ApplicationContext.log SessionListener:
contextInitialized()


--
Best regards, Wulf

signature.asc

Wulf C. Krueger

unread,
Oct 4, 2016, 9:26:58 AM10/4/16
to repo-d...@googlegroups.com
On 10/02/16 12:21, Wulf C. Krueger wrote:
> I've tried updating from Gerrit 2.12.3 to 2.13.1 but now Gerrit fails to
> start inside its (so far perfectly working) Tomcat:

Really no ideas? Nobody is running Gerrit under Tomcat or another
non-Jetty application server?

--
Best regards, Wulf

signature.asc

Luca Milanesio

unread,
Oct 4, 2016, 9:28:16 AM10/4/16
to Wulf C. Krueger, repo-d...@googlegroups.com
Hi Wulf,
it is not a very common scenario, most of the people use Jetty.
Additionally not so many people have upgraded to Gerrit 2.13.x yet.

Luca.
> --
> --
> To unsubscribe, email repo-discuss...@googlegroups.com
> More info at http://groups.google.com/group/repo-discuss?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Thomas Meyer

unread,
Oct 23, 2016, 1:58:07 PM10/23/16
to Repo and Gerrit Discussion

Hi,

looks like commit 220a3f5d03b127e892bbc5f5458a74e23bb390f9 did introduce some funky circular dependency between the database module and NotesMigration (ConfigNotesMigration).
So running gerrit with a site path set in the database only was broken, Daemon.java solves this by explicitly setting the site path.

with this patch you can run gerrit in an servlet container:
diff --git a/gerrit-war/src/main/java/com/google/gerrit/httpd/WebAppInitializer.java b/gerrit-war/src/main/java/com/googl/gerrit/httpd/WebAppInitializer.java
index 71eed63..7e1b228 100644
--- a/gerrit-war/src/main/java/com/google/gerrit/httpd/WebAppInitializer.java
+++ b/gerrit-war/src/main/java/com/google/gerrit/httpd/WebAppInitializer.java
@@ -266,6 +266,7 @@ public class WebAppInitializer extends GuiceServletContextListener
       });
     }
     modules.add(new DatabaseModule());
+    modules.add(new ConfigNotesMigration.Module());
     modules.add(new DropWizardMetricMaker.ApiModule());
     return Guice.createInjector(PRODUCTION, modules);
   }
@@ -287,7 +288,6 @@ public class WebAppInitializer extends GuiceServletContextListener
       modules.add(new GerritServerConfigModule());
     }
     modules.add(new SchemaModule());
-    modules.add(new ConfigNotesMigration.Module());
     modules.add(SchemaVersionCheck.module());
     modules.add(new AuthConfigModule());
     return dbInjector.createChildInjector(modules);
 
You need to set the System property "-Dgerrit.site_path=/home/thomas/gerrit" to make above patch work. the site path in the database became practically obsolete with NotesMigration change mentioned above.

Thomas Meyer

unread,
Oct 23, 2016, 2:02:29 PM10/23/16
to Repo and Gerrit Discussion
somebody should check (the probably duplicate) start sequence code in WebAppInitializer.java and Daemon.java and try to refactor this into a common code base...

David Ostrovsky

unread,
Oct 25, 2016, 1:36:53 AM10/25/16
to Repo and Gerrit Discussion
[...]

Would you upload a change to gerrit-review, to stable-2.13 branch for that?

Thomas Meyer

unread,
Oct 25, 2016, 3:41:25 AM10/25/16
to Repo and Gerrit Discussion
Will do so!

Reyad Attiyat

unread,
Dec 3, 2016, 4:08:57 AM12/3/16
to Repo and Gerrit Discussion
I think the following bug report refers to the same issue.

I added the patch there to hopefully get this moved into the next release.

On Tuesday, October 25, 2016 at 2:41:25 AM UTC-5, Thomas Meyer wrote:
Will do so!
Reply all
Reply to author
Forward
0 new messages