Springboot app error on Google Cloud Run due to HikariPool initialization

I have a springboot app that uses JDBC and uses both openjdk11 on my Ubuntu laptop and in my DockerFile. Every time I run the app locally on both the regular jar and container, the app works but on GCR it fails due to this error, HikariPool-1: GCR logs

Here is my dockerfile:

FROM adoptopenjdk/openjdk11:x86_64-ubuntu-jdk-11.0.8_10 ARG JAR_FILE=target/*.jar COPY ${JAR_FILE} app.jar ENTRYPOINT ["java","-jar","/app.jar"] 

Here is my pom.xml:

<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">     <modelVersion>4.0.0</modelVersion>     <parent>         <groupId>org.springframework.boot</groupId>         <artifactId>spring-boot-starter-parent</artifactId>         <version>2.3.1.RELEASE</version>         <relativePath/> <!-- lookup parent from repository -->     </parent>     <groupId>me.andrewq</groupId>     <artifactId>coffeeshop</artifactId>     <version>0.0.1-SNAPSHOT</version>     <name>coffeeshop</name>     <description>Back-end for a Coffee Shop 'store'</description>      <properties>         <java.version>11</java.version>         <!-- <maven.compiler.source>1.11</maven.compiler.source>         <maven.compiler.target>1.11</maven.compiler.target> -->     </properties>      <dependencies>         <dependency>             <groupId>org.springframework.boot</groupId>             <artifactId>spring-boot-starter-web</artifactId>         </dependency>          <dependency>             <groupId>org.springframework.boot</groupId>             <artifactId>spring-boot-starter-mail</artifactId>             <version>2.3.3.RELEASE</version>         </dependency>          <dependency>             <groupId>mysql</groupId>             <artifactId>mysql-connector-java</artifactId>             <!-- <version>8.0.21</version> -->             <scope>runtime</scope>         </dependency>                  <dependency>             <groupId>org.springframework.boot</groupId>             <artifactId>spring-boot-starter-data-jdbc</artifactId>         </dependency>          <dependency>             <groupId>org.springframework.boot</groupId>             <artifactId>spring-boot-starter-test</artifactId>             <scope>test</scope>             <exclusions>                 <exclusion>                     <groupId>org.junit.vintage</groupId>                     <artifactId>junit-vintage-engine</artifactId>                 </exclusion>             </exclusions>         </dependency>     </dependencies>      <build>         <plugins>             <plugin>                 <groupId>org.springframework.boot</groupId>                 <artifactId>spring-boot-maven-plugin</artifactId>             </plugin>          </plugins>     </build>  </project> 

Java version:

openjdk 11.0.8 2020-07-14 OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.8+10) OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.8+10, mixed mode) 

Application.properties:

spring.datasource.driverclassname = com.mysql.cj.jdbc.Driver spring.datasource.url=jdbc:mysql://${MYSQL_HOST:12.345.678.90}:3306/CoffeeShop?useUnicode=true&useLegacyDatetimeCode=false&serverTimezone=UTC  spring.datasource.username=username spring.datasource.password=password  spring.mail.host=smtp.gmail.com spring.mail.port=587  spring.mail.username=email spring.mail.password=password spring.mail.properties.mail.smtp.auth=true spring.mail.properties.mail.smtp.starttls.enable=true 
Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.