SonarQube 6.7.1 WEB 不适用于 JDBC 42.1.4 [默认]

SonarQube 6.7.1 WEB not work with JDBC 42.1.4 [default]

OS: Uduntu 16.04 64 位 LTS
SonarQube:6.7.1
PostgreSQL: 9.5
Java: 1.8.0_144

默认 SonarQube 有 JDBC 42.1.4 和 web.log 中的以下错误:

ERROR web[][o.postgresql.Driver] Connection error:
org.postgresql.util.PSQLException: The connection attempt failed.
        at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:275)
        at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
        at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:194)
        at org.postgresql.Driver.makeConnection(Driver.java:450)
        at org.postgresql.Driver.connect(Driver.java:252)
        at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
        at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
        at org.apache.commons.pool.impl.GenericObjectPool.addObject(GenericObjectPool.java:1617)
        at org.apache.commons.pool.impl.GenericObjectPool.ensureMinIdle(GenericObjectPool.java:1575)
        at org.apache.commons.pool.impl.GenericObjectPool.access0(GenericObjectPool.java:190)
        at org.apache.commons.pool.impl.GenericObjectPool$Evictor.run(GenericObjectPool.java:1709)
        at java.util.TimerThread.mainLoop(Timer.java:555)
        at java.util.TimerThread.run(Timer.java:505)
Caused by: java.net.UnknownHostException: localhost

但是当我更新到 JDBC 4.2 驱动程序时,42.2.1 运行良好。

也许来自 sonarqube 的人看到并修复了它。

确实SonarQube 6.7.1中打包的PostgreSQL驱动版本存在一些bug。驱动程序在 SonarQube 6.7.2 中升级,在撰写本文时尚未发布。 查看相关工单:https://jira.sonarsource.com/browse/SONAR-10296