Problems running current Gerrit with Tomcat 6

918 views
Skip to first unread message

ThorQue

unread,
Feb 4, 2011, 5:00:00 PM2/4/11
to Repo and Gerrit Discussion
Hello,

I am trying to get gerrit with Tomcat running. I am getting always
this exception:

[2011-02-04 22:53:08,315] ERROR
com.google.gerrit.httpd.WebAppInitializer : Cannot create ReviewDb
caused by com.google.gwtorm.client.OrmException: Unable to determine
driver URL
caused by org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot
create JDBC driver of class '' for connect URL 'null'
caused by java.sql.SQLException: No suitable driver

Resolve above errors before continuing.
Complete stack trace follows:
com.google.gwtorm.client.OrmException: Unable to determine driver URL
at com.google.gwtorm.jdbc.Database.<init>(Database.java:130)
at
com.google.gerrit.server.schema.ReviewDbDatabaseProvider.get(ReviewDbDatabaseProvider.java:
39)
at
com.google.gerrit.server.schema.ReviewDbDatabaseProvider.get(ReviewDbDatabaseProvider.java:
28)
...
Caused by: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot
create JDBC driver of class '' for connect URL 'null'
at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:
1452)
at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:
1371)
at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:
1044)
at com.google.gwtorm.jdbc.Database.<init>(Database.java:109)
... 34 more
Caused by: java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getDriver(DriverManager.java:264)
at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:
1437)

I have added the jndi datasource to tomcat and added the mysql libs to
tomcat libs.
I am trying this on Mac with Java 6.

Thorsten

Shawn Pearce

unread,
Feb 5, 2011, 2:41:33 PM2/5/11
to ThorQue, Repo and Gerrit Discussion

Go back and double check your Tomcat configuration. It looks like
Tomcat doesn't have the right data and thus cannot setup the
connection for Gerrit.

ThorQue

unread,
Feb 5, 2011, 4:37:20 PM2/5/11
to Repo and Gerrit Discussion
Hello,

the first problem with JNDI-DS is solved. I am creating a common/lib
directory and copying the mysql-*.jar.

Now the next problem is:
java.security.NoSuchProviderException: no such provider: BC

I have copied the bcprov-*.jar into the common/lib, too. But this has
no effect.
Pushing a change works fine, but if hudson build a change and want to
set the Verified-Marker this exception occured.

What I am missing?

Thorsten

On 5 Feb., 20:41, Shawn Pearce <s...@google.com> wrote:

Shawn Pearce

unread,
Feb 5, 2011, 5:37:50 PM2/5/11
to ThorQue, Repo and Gerrit Discussion
On Sat, Feb 5, 2011 at 13:37, ThorQue <thorste...@googlemail.com> wrote:
> the first problem with JNDI-DS is solved. I am creating a common/lib
> directory and copying the mysql-*.jar.
>
> Now the next problem is:
> java.security.NoSuchProviderException: no such provider: BC
>
> I have copied the bcprov-*.jar into the common/lib, too. But this has
> no effect.
> Pushing a change works fine, but if hudson build a change and want to
> set the Verified-Marker this exception occured.

That sounds like the embedded SSHD cannot load the host key, because
it cannot find the BouncyCastle JARs. Make sure the JARs are copied
in from $site_path/lib and restart the Tomcat container? I've never
tried to use the SSHD with BouncyCastle under Tomcat, I've only used
it under the embedded Jetty that Gerrit comes with.

You could try to remove the need for BouncyCastle by removing the bc
JARs from $site_path/lib, removing the host keys from $site_path/etc,
and re-running init. Instead of answering "y" to the BouncyCastle
question answer "n" and Gerrit will create the host key using a
serialized Java object, which can be read without the BouncyCastle
code.

ThorQue

unread,
Feb 6, 2011, 11:09:13 AM2/6/11
to Repo and Gerrit Discussion
mhh...now I have tried something:

- In my Hudson job i have a post-buld action for sonar. If I
deactivate this Hudson can set the verified bit in gerrit properly.
After some builds the ssh connection fails with the BC error message

- Next try. I re-init the gerrit site without bouncycastle. The first
run works fine...but the second fails with the same error...

So I think gerrit isn't qualified to run in tomcat. The push from
eclipse works fine with tomact, but there are many problems with
hudson. I have spend 2 days to get it running but it seems to
unstable. Do you think this can be on your focus to get gerrit with
tomcat running?

This has some benefit: In an environment using tomcat as platform it
is able to monitor all services (eg. hudson, sonar, jira and so on)
with the same tools. But I thinks the solution with the embedded Jetty
works fine, too.

Bye
Thorsten

On 5 Feb., 23:37, Shawn Pearce <s...@google.com> wrote:

Shawn Pearce

unread,
Feb 11, 2011, 11:17:59 PM2/11/11
to ThorQue, Repo and Gerrit Discussion
On Sun, Feb 6, 2011 at 11:09, ThorQue <thorste...@googlemail.com> wrote:
> mhh...now I have tried something:
>
> - In my Hudson job i have a post-buld action for sonar. If I
> deactivate this Hudson can set the verified bit in gerrit properly.
>  After some builds the ssh connection fails with the BC error message

This is the Tomcat server running out of file descriptors I think. Try
increasing your Tomcat server to have more available file descriptors
by setting its ulimit higher when the server starts. The gerrit.sh
script that comes with Gerrit already knows to do this when its
running the internal Jetty.

I know, it seems unrelated to the error. But MINA SSHD seems to forget
its SSH public key sometimes, and then spits back this sort of garbage
when it cannot open its key because it ran out of file descriptors.

Reply all
Reply to author
Forward
0 new messages