Spring boot application is not starting

ε祈祈猫儿з 提交于 2021-01-07 02:50:04

问题


My spring boot application is not able to start. I am unable to find the root cause of that. I guess Hikari pool may create the issue for that. Below is the log. Any help will be appreciated.

{"timestamp": "12/22/2020 14:48:58:0354", "class": "com.zaxxer.hikari.pool.HikariPool$PoolEntryCreator", "file": "HikariPool.java", "level" : "DEBUG", "line_number" : "728", "url": "", "ip_address": "", "server_trace_id":"", "message": HikariPool-1 - Added connection org.postgresql.jdbc.PgConnection@b986d4e, "method": "call", "thread_name": "HikariPool-1 connection adder"},
{"timestamp": "12/22/2020 14:48:58:0368", "class": "com.zaxxer.hikari.HikariDataSource", "file": "HikariDataSource.java", "level" : " INFO", "line_number" : "350", "url": "", "ip_address": "", "server_trace_id":"", "message": HikariPool-1 - Shutdown initiated..., "method": "close", "thread_name": "restartedMain"},
{"timestamp": "12/22/2020 14:48:58:0369", "class": "com.zaxxer.hikari.pool.HikariPool", "file": "HikariPool.java", "level" : "DEBUG", "line_number" : "421", "url": "", "ip_address": "", "server_trace_id":"", "message": HikariPool-1 - Before shutdown stats (total=6, active=0, idle=6, waiting=0), "method": "logPoolState", "thread_name": "restartedMain"},
{"timestamp": "12/22/2020 14:48:58:0375", "class": "com.zaxxer.hikari.pool.PoolBase", "file": "PoolBase.java", "level" : "DEBUG", "line_number" : "134", "url": "", "ip_address": "", "server_trace_id":"", "message": HikariPool-1 - Closing connection org.postgresql.jdbc.PgConnection@25f592ec: (connection evicted), "method": "quietlyCloseConnection", "thread_name": "HikariPool-1 connection closer"},
{"timestamp": "12/22/2020 14:48:58:0378", "class": "com.zaxxer.hikari.pool.PoolBase", "file": "PoolBase.java", "level" : "DEBUG", "line_number" : "134", "url": "", "ip_address": "", "server_trace_id":"", "message": HikariPool-1 - Closing connection org.postgresql.jdbc.PgConnection@36e8820f: (connection evicted), "method": "quietlyCloseConnection", "thread_name": "HikariPool-1 connection closer"},
{"timestamp": "12/22/2020 14:48:58:0379", "class": "com.zaxxer.hikari.pool.PoolBase", "file": "PoolBase.java", "level" : "DEBUG", "line_number" : "134", "url": "", "ip_address": "", "server_trace_id":"", "message": HikariPool-1 - Closing connection org.postgresql.jdbc.PgConnection@382f7aa2: (connection evicted), "method": "quietlyCloseConnection", "thread_name": "HikariPool-1 connection closer"},
{"timestamp": "12/22/2020 14:48:58:0380", "class": "com.zaxxer.hikari.pool.PoolBase", "file": "PoolBase.java", "level" : "DEBUG", "line_number" : "134", "url": "", "ip_address": "", "server_trace_id":"", "message": HikariPool-1 - Closing connection org.postgresql.jdbc.PgConnection@3c10e97f: (connection evicted), "method": "quietlyCloseConnection", "thread_name": "HikariPool-1 connection closer"},
{"timestamp": "12/22/2020 14:48:58:0380", "class": "com.zaxxer.hikari.pool.PoolBase", "file": "PoolBase.java", "level" : "DEBUG", "line_number" : "134", "url": "", "ip_address": "", "server_trace_id":"", "message": HikariPool-1 - Closing connection org.postgresql.jdbc.PgConnection@79127099: (connection evicted), "method": "quietlyCloseConnection", "thread_name": "HikariPool-1 connection closer"},
{"timestamp": "12/22/2020 14:48:58:0381", "class": "com.zaxxer.hikari.pool.PoolBase", "file": "PoolBase.java", "level" : "DEBUG", "line_number" : "134", "url": "", "ip_address": "", "server_trace_id":"", "message": HikariPool-1 - Closing connection org.postgresql.jdbc.PgConnection@b986d4e: (connection evicted), "method": "quietlyCloseConnection", "thread_name": "HikariPool-1 connection closer"},
{"timestamp": "12/22/2020 14:48:58:0388", "class": "com.zaxxer.hikari.pool.HikariPool$PoolEntryCreator", "file": "HikariPool.java", "level" : "DEBUG", "line_number" : "728", "url": "", "ip_address": "", "server_trace_id":"", "message": HikariPool-1 - Added connection org.postgresql.jdbc.PgConnection@48a1ecf5, "method": "call", "thread_name": "HikariPool-1 connection adder"},
{"timestamp": "12/22/2020 14:48:58:0388", "class": "com.zaxxer.hikari.pool.PoolBase", "file": "PoolBase.java", "level" : "DEBUG", "line_number" : "134", "url": "", "ip_address": "", "server_trace_id":"", "message": HikariPool-1 - Closing connection org.postgresql.jdbc.PgConnection@48a1ecf5: (connection evicted), "method": "quietlyCloseConnection", "thread_name": "HikariPool-1 connection closer"},
{"timestamp": "12/22/2020 14:48:58:0389", "class": "com.zaxxer.hikari.pool.HikariPool", "file": "HikariPool.java", "level" : "DEBUG", "line_number" : "421", "url": "", "ip_address": "", "server_trace_id":"", "message": HikariPool-1 - After shutdown stats (total=0, active=0, idle=0, waiting=0), "method": "logPoolState", "thread_name": "restartedMain"},
{"timestamp": "12/22/2020 14:48:58:0389", "class": "com.zaxxer.hikari.HikariDataSource", "file": "HikariDataSource.java", "level" : " INFO", "line_number" : "352", "url": "", "ip_address": "", "server_trace_id":"", "message": HikariPool-1 - Shutdown completed., "method": "close", "thread_name": "restartedMain"},
{"timestamp": "12/22/2020 14:48:58:0390", "class": "org.apache.http.impl.conn.PoolingHttpClientConnectionManager", "file": "PoolingHttpClientConnectionManager.java", "level" : "DEBUG", "line_number" : "411", "url": "", "ip_address": "", "server_trace_id":"", "message": Connection manager is shutting down, "method": "shutdown", "thread_name": "restartedMain"},
{"timestamp": "12/22/2020 14:48:58:0390", "class": "com.amazonaws.http.IdleConnectionReaper", "file": "IdleConnectionReaper.java", "level" : "DEBUG", "line_number" : "190", "url": "", "ip_address": "", "server_trace_id":"", "message": Reaper thread: , "method": "run", "thread_name": "java-sdk-http-connection-reaper"},
java.lang.InterruptedException: sleep interrupted
    at java.lang.Thread.sleep(Native Method) ~[?:?]
    at com.amazonaws.http.IdleConnectionReaper.run(IdleConnectionReaper.java:188) [aws-java-sdk-core-1.11.908.jar:?]
IdleConnectionReaper.java:188
{"timestamp": "12/22/2020 14:48:58:0390", "class": "com.amazonaws.http.IdleConnectionReaper", "file": "IdleConnectionReaper.java", "level" : "DEBUG", "line_number" : "194", "url": "", "ip_address": "", "server_trace_id":"", "message": Shutting down reaper thread., "method": "run", "thread_name": "java-sdk-http-connection-reaper"},
{"timestamp": "12/22/2020 14:48:58:0390", "class": "org.apache.http.impl.conn.LoggingManagedHttpClientConnection", "file": "LoggingManagedHttpClientConnection.java", "level" : "DEBUG", "line_number" : "79", "url": "", "ip_address": "", "server_trace_id":"", "message": http-outgoing-0: Close connection, "method": "close", "thread_name": "restartedMain"},
{"timestamp": "12/22/2020 14:48:58:0391", "class": "com.amazonaws.internal.SdkSSLSocket", "file": "SdkSSLSocket.java", "level" : "DEBUG", "line_number" : "76", "url": "", "ip_address": "", "server_trace_id":"", "message": shutting down output of xxx, "method": "shutdownOutput", "thread_name": "restartedMain"},
{"timestamp": "12/22/2020 14:48:58:0391", "class": "com.amazonaws.internal.SdkSSLSocket", "file": "SdkSSLSocket.java", "level" : "DEBUG", "line_number" : "69", "url": "", "ip_address": "", "server_trace_id":"", "message": shutting down input of xxx, "method": "shutdownInput", "thread_name": "restartedMain"},
{"timestamp": "12/22/2020 14:48:58:0391", "class": "com.amazonaws.internal.SdkSSLSocket", "file": "SdkSSLSocket.java", "level" : "DEBUG", "line_number" : "62", "url": "", "ip_address": "", "server_trace_id":"", "message": closing xxx, "method": "close", "thread_name": "restartedMain"},
{"timestamp": "12/22/2020 14:48:58:0391", "class": "org.apache.http.impl.conn.PoolingHttpClientConnectionManager", "file": "PoolingHttpClientConnectionManager.java", "level" : "DEBUG", "line_number" : "434", "url": "", "ip_address": "", "server_trace_id":"", "message": Connection manager shut down, "method": "shutdown", "thread_name": "restartedMain"},
{"timestamp": "12/22/2020 14:48:58:0395", "class": "org.apache.juli.logging.DirectJDKLog", "file": "DirectJDKLog.java", "level" : " INFO", "line_number" : "173", "url": "", "ip_address": "", "server_trace_id":"", "message": Stopping service [Tomcat], "method": "log", "thread_name": "restartedMain"},

Here is a complete maven configuration of my project which I have used. I am using spring boot 2.4.3 with spring data jpa

<?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.4.RELEASE</version>
    <relativePath /> <!-- lookup parent from repository -->
  </parent>
  <groupId>xxx</groupId>
  <artifactId>xxx</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <name>xxxn</name>
  <description>Application of xxx</description>

  <properties>
    <java.version>14</java.version>
    <java.aws.version>1.11.908</java.aws.version>

    <sonar.projectKey>xxxx</sonar.projectKey>
    <sonar.organization>xxx</sonar.organization>
    <sonar.host.url>xxx</sonar.host.url>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-web</artifactId>
      <exclusions>
        <exclusion>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-starter-logging</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-log4j2</artifactId>
    </dependency>

    <dependency>
      <groupId>com.lmax</groupId>
      <artifactId>disruptor</artifactId>
      <version>3.3.7</version>
    </dependency>

    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>

    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-data-jpa</artifactId>
    </dependency>

    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-devtools</artifactId>
      <scope>runtime</scope>
      <optional>true</optional>
    </dependency>

    <!-- AWS related dependencies -->
    <dependency>
      <groupId>com.amazonaws</groupId>
      <artifactId>aws-java-sdk-secretsmanager</artifactId>
      <version>${java.aws.version}</version>
    </dependency>

    <dependency>
      <groupId>org.postgresql</groupId>
      <artifactId>postgresql</artifactId>
      <scope>runtime</scope>
    </dependency>

    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
      <optional>true</optional>
    </dependency>

    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-spring-cloud-config-client</artifactId>
      <exclusions>
        <exclusion>
          <groupId>org.springframework.cloud</groupId>
          <artifactId>spring-cloud-bus</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-validation</artifactId>
    </dependency>

    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-security</artifactId>
    </dependency>

    <dependency>
      <groupId>io.jsonwebtoken</groupId>
      <artifactId>jjwt</artifactId>
      <version>0.9.1</version>
    </dependency>

    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-validation</artifactId>
    </dependency>

    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-oauth2-resource-server</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>

    <!--rest-assured dependency -->
    <dependency>
      <groupId>io.rest-assured</groupId>
      <artifactId>rest-assured</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>2.7</version>
    </dependency>

    <dependency>
      <groupId>com.auth0</groupId>
      <artifactId>java-jwt</artifactId>
      <version>3.10.3</version>
    </dependency>


    <dependency>
      <groupId>io.springfox</groupId>
      <artifactId>springfox-swagger2</artifactId>
      <version>2.9.2</version>
    </dependency>

    <dependency>
      <groupId>io.springfox</groupId>
      <artifactId>springfox-swagger-ui</artifactId>
      <version>2.9.2</version>
    </dependency>
    <dependency>
      <groupId>io.swagger.codegen.v3</groupId>
      <artifactId>swagger-codegen-maven-plugin</artifactId>
      <version>3.0.23</version>
      <exclusions>
        <exclusion>
          <groupId>ch.qos.logback</groupId>
          <artifactId>logback-core</artifactId>
        </exclusion>
        <exclusion>
          <groupId>ch.qos.logback</groupId>
          <artifactId>logback-classic</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.mapstruct</groupId>
      <artifactId>mapstruct</artifactId>
      <version>1.4.1.Final</version>
    </dependency>

    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-webflux</artifactId>
    </dependency>

    <dependency>
      <groupId>com.atlassian.connect</groupId>
      <artifactId>atlassian-connect-spring-boot-jwt</artifactId>
      <version>2.1.2</version>
    </dependency>

    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>2.7</version>
    </dependency>

    <dependency>
      <groupId>com.auth0</groupId>
      <artifactId>java-jwt</artifactId>
      <version>3.10.3</version>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <configuration>
          <mainClass>com.ai.redpen.RedpenApplication</mainClass>
          <source>14</source>
          <target>14</target>
        </configuration>
      </plugin>

      <plugin>
        <groupId>io.swagger</groupId>
        <artifactId>swagger-codegen-maven-plugin</artifactId>
        <version>2.3.1</version>
        <executions>
          <execution>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <inputSpec>${project.basedir}/misc/swagger/swagger.yaml</inputSpec>
              <language>spring</language>
              <library>spring-boot</library>
              <apiPackage>com.ai.redpen.controller</apiPackage>
              <modelPackage>com.ai.redpen.dto</modelPackage>
              <generateApis>true</generateApis>
              <generateModels>true</generateModels>
              <generateApiTests>false</generateApiTests>
              <generateModelTests>false</generateModelTests>
              <skipOverwrite>false</skipOverwrite>
              <generateSupportingFiles>false</generateSupportingFiles>
              <configOptions>
                <interfaceOnly>true</interfaceOnly>
                <java8>false</java8>
                <dateLibrary>java8</dateLibrary>
              </configOptions>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.1</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
          <annotationProcessorPaths>
            <path>
              <groupId>org.mapstruct</groupId>
              <artifactId>mapstruct-processor</artifactId>
              <version>1.4.1.Final</version>
            </path>
            <path>
              <groupId>org.projectlombok</groupId>
              <artifactId>lombok</artifactId>
              <version>${lombok.version}</version>
            </path>
          </annotationProcessorPaths>
        </configuration>
      </plugin>
    </plugins>
  </build>

</project>

来源:https://stackoverflow.com/questions/65406134/spring-boot-application-is-not-starting

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!