Failed to start gerrit under tomcat - 'Error filterStart'

766 views
Skip to first unread message

BenNiu Ji

unread,
Nov 21, 2013, 10:13:23 AM11/21/13
to repo-d...@googlegroups.com
Hi, all

I'm trying to deploy gerrit under tomcat. But after putting the war under webapps and restart the tomcat, gerrit can no longer be accessed. The return code is 404.

I checked the log, it was saying "SEVERE: Error filterStart" and "SEVERE: Context [/gerrit] startup failed due to previous errors".

Does anyone know why this happened and any solutions?

Thank you!




log:

Nov 21, 2013 6:27:45 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Nov 21, 2013 6:27:46 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 486 ms
Nov 21, 2013 6:27:46 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Nov 21, 2013 6:27:46 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.26
Nov 21, 2013 6:27:46 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive /var/lib/tomcat7/webapps/gerrit.war
[2013-11-21 06:27:49,460] INFO  com.google.gerrit.server.cache.h2.H2CacheFactory : Enabling disk cache /home/git/sas-gerrit/cache
Nov 21, 2013 6:27:50 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error filterStart
Nov 21, 2013 6:27:50 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/gerrit] startup failed due to previous errors
Nov 21, 2013 6:27:50 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/gerrit] appears to have started a thread named [com.google.inject.internal.util.$Finalizer] but has failed to stop it. This is very likely to create a memory leak.
Nov 21, 2013 6:27:50 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/gerrit] appears to have started a thread named [ProjectCacheClock-0] but has failed to stop it. This is very likely to create a memory leak.
Nov 21, 2013 6:27:50 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/gerrit] appears to have started a thread named [AsyncAppender-Dispatcher-Thread-3] but has failed to stop it. This is very likely to create a memory leak.
Nov 21, 2013 6:27:50 AM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/gerrit] created a ThreadLocal with key of type [com.google.inject.internal.InjectorImpl$1] (value [com.google.inject.internal.InjectorImpl$1@76c27ba]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@4da42824]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
Nov 21, 2013 6:27:50 AM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/gerrit] created a ThreadLocal with key of type [com.google.inject.internal.InjectorImpl$1] (value [com.google.inject.internal.InjectorImpl$1@54477b4e]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@20f0691c]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
Nov 21, 2013 6:27:50 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /var/lib/tomcat7/webapps/ROOT
Nov 21, 2013 6:27:50 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Nov 21, 2013 6:27:50 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 4820 ms



Thanks,
Ben

Shawn Pearce

unread,
Nov 21, 2013, 11:46:23 AM11/21/13
to BenNiu Ji, repo-discuss
On Thu, Nov 21, 2013 at 7:13 AM, BenNiu Ji <benn...@gmail.com> wrote:
> I'm trying to deploy gerrit under tomcat. But after putting the war under
> webapps and restart the tomcat, gerrit can no longer be accessed. The return
> code is 404.

What version of Gerrit?

There was a bug with the plugin system that caused a plugin to "steal"
the web context from Gerrit and thus Gerrit's content disappeared from
the web space when a plugin loaded, e.g. the replication plugin.

BenNiu Ji

unread,
Nov 21, 2013, 8:31:39 PM11/21/13
to repo-d...@googlegroups.com, BenNiu Ji
Thanks, Shawn. I'm using gerrit 2.7

Shawn Pearce

unread,
Nov 22, 2013, 11:54:52 AM11/22/13
to BenNiu Ji, repo-discuss
On Thu, Nov 21, 2013 at 5:31 PM, BenNiu Ji <benn...@gmail.com> wrote:
> Thanks, Shawn. I'm using gerrit 2.7

OK, its not what I was thinking about, because that issue was fixed in 2.7:

commit 09a35b97254f84624775f15283aa6bffaadcda70
Author: Shawn Pearce <s...@google.com>
Date: Thu Aug 8 17:46:09 2013 -0700

Fix Gerrit plugins under Tomcat by avoiding Guice static filter

The static GuiceFilter breaks when a plugin loads and configures
its own web environment. Follow the pattern used by JettyServer
to initialize and load GuiceFilter in a non-static way, allowing
Gerrit to always have its own filter stack during any request.

Bug: issue 1966
Change-Id: I864f3badc4ec90154a276d35e6a5a3fa75058933

Notes (review):
Code-Review+2: Shawn Pearce <s...@google.com>
Verified+1: Shawn Pearce <s...@google.com>
Code-Review+1: David Ostrovsky <david.o...@gmail.com>
Verified+1: David Ostrovsky <david.o...@gmail.com>
Submitted-by: Shawn Pearce <s...@google.com>
Submitted-at: Mon, 12 Aug 2013 18:56:46 +0000
Reviewed-on: https://gerrit-review.googlesource.com/48710
Project: gerrit
Branch: refs/heads/stable-2.6

Shawn Pearce

unread,
Nov 22, 2013, 11:58:51 AM11/22/13
to BenNiu Ji, repo-discuss
On Thu, Nov 21, 2013 at 7:13 AM, BenNiu Ji <benn...@gmail.com> wrote:
> I'm trying to deploy gerrit under tomcat. But after putting the war under
> webapps and restart the tomcat, gerrit can no longer be accessed. The return
> code is 404.
>
> I checked the log, it was saying "SEVERE: Error filterStart" and "SEVERE:
> Context [/gerrit] startup failed due to previous errors".

Its probably a misconfiguration in gerrit.config. Unfortunately the
exception was lost. Tomcat felt it was necessary to log the SEVERE
Error filterStart but did not bother to include the cause of this. It
then later complained we didn't shutdown correctly, which I can
understand because startup didn't go correctly so the application
didn't finish tracking the threads it created.

Does gerrit daemon start on its own?
Is there a problem with the datasource context being passed from
Tomcat to Gerrit for the database access?

BenNiu Ji

unread,
Nov 25, 2013, 2:10:14 AM11/25/13
to repo-d...@googlegroups.com, BenNiu Ji
Thanks Shawn. It finally works after I copied all jars under '$site_path'/lib into tomcat's lib.
Reply all
Reply to author
Forward
0 new messages