简体   繁体   中英

Gerrit Setup Fails With org.mariadb.jdbc.Driver not available

I have a RHEL 7 machine that I am trying to setup with Gerrit. I downloaded gerrit-2.14.6.war into /home/gerrit2. I logged into MariaDB and created a gerrit2 user (with password) and created a 'reviewdb' database.

I then logged in as the gerrit2 user and executed java -jar gerrit-2.14.6.war init -d /home/gerrit2/gerrit . I answered the questions and it installs successfully. I then executed bin/gerrit.sh start and it started successfully.

So, my shop is really weird. We have Windows machine that is our machine at our desk but all of our development is on Linux and the servers are off in another building. I typically access these machines using something like MobaXterm (or PuTTY, basically SSH). My shop does not have a DNS server and they have administratively locked down my hosts file so I cannot add a IP address and hostname to the hosts file on my Windows machine. So, when I opened my web browser, I typed in the IP address of the machine to access it. I was able to successfully do this and then I clicked on Sign In. I entered my username but it barfed an error at me saying that the account did not exist or something like that. I clicked "Back" in the web browser and it barfed another error stating it could not find the webpage. That is when I noticed that my web browser was trying to find the webpage based off the hostname of the machine rather than the IP address.

I looked in /home/gerrit2/gerrit/etc/gerrit.config and found the canonicalURL property is set to http://hostname.of.the.server:8080 . I changed that to http://123.123.123.123:8080 and restarted the Gerrit service and now the service will not start. This leads me to believe that there are other hooks in Gerrit that need to be changed as well.

Instead of trying to figure out where all of the hooks are, I decided to just blow alway the whole installation and rebuild again from scratch. I did a rm -rf /home/gerrit2/gerrit and then performed java -jar gerrit-2.14.6.war init -d /home/gerrit2/gerrit again. But, now, it goes all the way to the end and then barfs this error:

fatal: Driver class org.mariadb.jdbc.Driver not available fatal: Cannot connect to SQL database

This makes no sense to me since I did not touch the Java stuff at all. Why is it all of the sudden complaining about this now even though it worked earlier? I have tried finding this by doing find /usr/lib/jvm -type f -print | xargs grep -i maria find /usr/lib/jvm -type f -print | xargs grep -i maria but there were no matches.

Any ideas what I did to break this and how to fix it?

当询问您是否要安装MariaDB Connector / J时,如果您单击Y会很有帮助。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM