0

In Jenkins switching from env.JAVA_HOME="${tool 'JDK_7u80'}" to javaHome = tool 'JDK_8u74' causes timeout and checkFailFast. I'm using

<dependency>
    <groupId>com.zaxxer</groupId>
    <artifactId>HikariCP</artifactId>
    <version>3.0.0</version>
</dependency>

and

@Bean(destroyMethod = "close")
DataSource dataSource(Environment env) {
    HikariConfig dataSourceConfig = new HikariConfig();
    dataSourceConfig.setDriverClassName(env.getRequiredProperty("db.driver"));
    dataSourceConfig.setJdbcUrl(env.getRequiredProperty("db.url"));
    dataSourceConfig.setUsername(env.getRequiredProperty("db.username"));
    dataSourceConfig.setPassword(env.getRequiredProperty("db.password"));
    System.out.println("Trying to connect to: " + dataSourceConfig.getJdbcUrl());
    return new HikariDataSource(dataSourceConfig);
}

2018-04-18 19:44:18, 987 HikariDataSource [INFO] HikariPool-1 - Starting... . . .Caused by: com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: The TCP/IP connection to the host XXX, port YYY has failed. Error: "Connection timed out: no further information.. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.". at com.zaxxer.hikari.pool.HikariPool.throwPoolInitializationException(HikariPool.java:576) at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:562) at com.zaxxer.hikari.pool.HikariPool.(HikariPool.java:115) at com.zaxxer.hikari.HikariDataSource.(HikariDataSource.java:81) at com.travelport.ep.datastore.springdatajpa.config.SqlServerConfig.dataSource(SqlServerConfig.java:42)

MtnKat
  • 1
  • 3
  • That error message is directly from the driver. Are the host and port reported in the error accurate? If so, you can try to manually telnet to that host and port from the CLI. If the connection is refused, your problem lies elsewhere. – brettw Apr 27 '18 at 19:28
  • The problem was that Jenkins is not able to get to sql server. – MtnKat May 18 '18 at 19:53
  • @MtnKat how did you resolve this? ... I'm having the same issue – rHenderson Sep 13 '18 at 13:42
  • 1
    @rHenderson Our set up was that the database access was specified in the service using the data access library. I set it to skipTests in Jenkins when building the library. I don't remember why it seemed it was a Java 7 to 8 issue... – MtnKat Sep 14 '18 at 15:59

0 Answers0