当前位置: 首页 > 知识库问答 >
问题:

如何在不关闭HikariPool的情况下使用光数据源运行springboot应用程序

窦哲彦
2023-03-14

我有一个带有maven的spring boot应用程序,并使用Hikari数据源连接Mysql数据库。但当我运行spring boot应用程序时,HikariPool关机启动如下:

C:\Users\Admin\.jdks\corretto-11.0.12\bin\java.exe -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2021.1.2\lib\idea_rt.jar=58795:C:\Program Files\JetBrains\IntelliJ IDEA 2021.1.2\bin" -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true -Dfile.encoding=UTF-8 -classpath C:\Users\Admin\Desktop\PiratedMovieWeb\target\classes;C:\Users\Admin\Desktop\PiratedMovieWeb\lib\javax.jms.jar;C:\Users\Admin\Desktop\PiratedMovieWeb\lib\javax.servlet.jsp.jstl.jar;C:\Users\Admin\Desktop\PiratedMovieWeb\lib\javax.resource.jar;C:\Users\Admin\Desktop\PiratedMovieWeb\lib\javax.servlet.jar;C:\Users\Admin\Desktop\PiratedMovieWeb\lib\javax.ejb.jar;C:\Users\Admin\Desktop\PiratedMovieWeb\lib\javax.servlet.jsp.jar;C:\Users\Admin\.m2\repository\org\springframework\boot\spring-boot-starter-oauth2-client\2.5.5\spring-boot-starter-oauth2-client-2.5.5.jar;C:\Users\Admin\.m2\repository\org\springframework\boot\spring-boot-starter\2.5.5\spring-boot-starter-2.5.5.jar;C:\Users\Admin\.m2\repository\org\springframework\boot\spring-boot-starter-logging\2.5.5\spring-boot-starter-logging-2.5.5.jar;C:\Users\Admin\.m2\repository\ch\qos\logback\logback-classic\1.2.6\logback-classic-1.2.6.jar;C:\Users\Admin\.m2\repository\ch\qos\logback\logback-core\1.2.6\logback-core-1.2.6.jar;C:\Users\Admin\.m2\repository\org\apache\logging\log4j\log4j-to-slf4j\2.14.1\log4j-to-slf4j-2.14.1.jar;C:\Users\Admin\.m2\repository\org\apache\logging\log4j\log4j-api\2.14.1\log4j-api-2.14.1.jar;C:\Users\Admin\.m2\repository\org\slf4j\jul-to-slf4j\1.7.32\jul-to-slf4j-1.7.32.jar;C:\Users\Admin\.m2\repository\jakarta\annotation\jakarta.annotation-api\1.3.5\jakarta.annotation-api-1.3.5.jar;C:\Users\Admin\.m2\repository\org\yaml\snakeyaml\1.28\snakeyaml-1.28.jar;C:\Users\Admin\.m2\repository\com\sun\mail\jakarta.mail\1.6.7\jakarta.mail-1.6.7.jar;C:\Users\Admin\.m2\repository\com\sun\activation\jakarta.activation\1.2.2\jakarta.activation-1.2.2.jar;C:\Users\Admin\.m2\repository\org\springframework\security\spring-security-config\5.5.2\spring-security-config-5.5.2.jar;C:\Users\Admin\.m2\repository\org\springframework\spring-aop\5.3.10\spring-aop-5.3.10.jar;C:\Users\Admin\.m2\repository\org\springframework\spring-context\5.3.10\spring-context-5.3.10.jar;C:\Users\Admin\.m2\repository\org\springframework\security\spring-security-core\5.5.2\spring-security-core-5.5.2.jar;C:\Users\Admin\.m2\repository\org\springframework\security\spring-security-crypto\5.5.2\spring-security-crypto-5.5.2.jar;C:\Users\Admin\.m2\repository\org\springframework\spring-expression\5.3.10\spring-expression-5.3.10.jar;C:\Users\Admin\.m2\repository\org\springframework\security\spring-security-oauth2-client\5.5.2\spring-security-oauth2-client-5.5.2.jar;C:\Users\Admin\.m2\repository\org\springframework\security\spring-security-oauth2-core\5.5.2\spring-security-oauth2-core-5.5.2.jar;C:\Users\Admin\.m2\repository\org\springframework\security\spring-security-web\5.5.2\spring-security-web-5.5.2.jar;C:\Users\Admin\.m2\repository\com\nimbusds\oauth2-oidc-sdk\9.9.1\oauth2-oidc-sdk-9.9.1.jar;C:\Users\Admin\.m2\repository\com\github\stephenc\jcip\jcip-annotations\1.0-1\jcip-annotations-1.0-1.jar;C:\Users\Admin\.m2\repository\com\nimbusds\content-type\2.1\content-type-2.1.jar;C:\Users\Admin\.m2\repository\com\nimbusds\lang-tag\1.5\lang-tag-1.5.jar;C:\Users\Admin\.m2\repository\org\springframework\security\spring-security-oauth2-jose\5.5.2\spring-security-oauth2-jose-5.5.2.jar;C:\Users\Admin\.m2\repository\com\nimbusds\nimbus-jose-jwt\9.10.1\nimbus-jose-jwt-9.10.1.jar;C:\Users\Admin\.m2\repository\org\springframework\boot\spring-boot-devtools\2.5.5\spring-boot-devtools-2.5.5.jar;C:\Users\Admin\.m2\repository\org\springframework\boot\spring-boot\2.5.5\spring-boot-2.5.5.jar;C:\Users\Admin\.m2\repository\org\springframework\boot\spring-boot-autoconfigure\2.5.5\spring-boot-autoconfigure-2.5.5.jar;C:\Users\Admin\.m2\repository\org\projectlombok\lombok\1.18.20\lombok-1.18.20.jar;C:\Users\Admin\.m2\repository\net\minidev\json-smart\2.4.7\json-smart-2.4.7.jar;C:\Users\Admin\.m2\repository\net\minidev\accessors-smart\2.4.7\accessors-smart-2.4.7.jar;C:\Users\Admin\.m2\repository\org\ow2\asm\asm\9.1\asm-9.1.jar;C:\Users\Admin\.m2\repository\jakarta\xml\bind\jakarta.xml.bind-api\2.3.3\jakarta.xml.bind-api-2.3.3.jar;C:\Users\Admin\.m2\repository\jakarta\activation\jakarta.activation-api\1.2.2\jakarta.activation-api-1.2.2.jar;C:\Users\Admin\.m2\repository\net\bytebuddy\byte-buddy\1.10.22\byte-buddy-1.10.22.jar;C:\Users\Admin\.m2\repository\org\springframework\spring-core\5.3.10\spring-core-5.3.10.jar;C:\Users\Admin\.m2\repository\org\springframework\spring-jcl\5.3.10\spring-jcl-5.3.10.jar;C:\Users\Admin\.m2\repository\org\springframework\boot\spring-boot-starter-data-jpa\2.5.6\spring-boot-starter-data-jpa-2.5.6.jar;C:\Users\Admin\.m2\repository\org\springframework\boot\spring-boot-starter-aop\2.5.5\spring-boot-starter-aop-2.5.5.jar;C:\Users\Admin\.m2\repository\org\aspectj\aspectjweaver\1.9.7\aspectjweaver-1.9.7.jar;C:\Users\Admin\.m2\repository\org\springframework\boot\spring-boot-starter-jdbc\2.5.5\spring-boot-starter-jdbc-2.5.5.jar;C:\Users\Admin\.m2\repository\jakarta\transaction\jakarta.transaction-api\1.3.3\jakarta.transaction-api-1.3.3.jar;C:\Users\Admin\.m2\repository\jakarta\persistence\jakarta.persistence-api\2.2.3\jakarta.persistence-api-2.2.3.jar;C:\Users\Admin\.m2\repository\org\hibernate\hibernate-core\5.4.32.Final\hibernate-core-5.4.32.Final.jar;C:\Users\Admin\.m2\repository\org\jboss\logging\jboss-logging\3.4.2.Final\jboss-logging-3.4.2.Final.jar;C:\Users\Admin\.m2\repository\org\javassist\javassist\3.27.0-GA\javassist-3.27.0-GA.jar;C:\Users\Admin\.m2\repository\antlr\antlr\2.7.7\antlr-2.7.7.jar;C:\Users\Admin\.m2\repository\org\jboss\jandex\2.2.3.Final\jandex-2.2.3.Final.jar;C:\Users\Admin\.m2\repository\com\fasterxml\classmate\1.5.1\classmate-1.5.1.jar;C:\Users\Admin\.m2\repository\org\dom4j\dom4j\2.1.3\dom4j-2.1.3.jar;C:\Users\Admin\.m2\repository\org\hibernate\common\hibernate-commons-annotations\5.1.2.Final\hibernate-commons-annotations-5.1.2.Final.jar;C:\Users\Admin\.m2\repository\org\glassfish\jaxb\jaxb-runtime\2.3.5\jaxb-runtime-2.3.5.jar;C:\Users\Admin\.m2\repository\org\glassfish\jaxb\txw2\2.3.5\txw2-2.3.5.jar;C:\Users\Admin\.m2\repository\com\sun\istack\istack-commons-runtime\3.0.12\istack-commons-runtime-3.0.12.jar;C:\Users\Admin\.m2\repository\org\springframework\data\spring-data-jpa\2.5.5\spring-data-jpa-2.5.5.jar;C:\Users\Admin\.m2\repository\org\springframework\data\spring-data-commons\2.5.5\spring-data-commons-2.5.5.jar;C:\Users\Admin\.m2\repository\org\springframework\spring-orm\5.3.10\spring-orm-5.3.10.jar;C:\Users\Admin\.m2\repository\org\springframework\spring-aspects\5.3.10\spring-aspects-5.3.10.jar;C:\Users\Admin\.m2\repository\org\springframework\boot\spring-boot-starter-web\2.5.5\spring-boot-starter-web-2.5.5.jar;C:\Users\Admin\.m2\repository\org\springframework\boot\spring-boot-starter-json\2.5.5\spring-boot-starter-json-2.5.5.jar;C:\Users\Admin\.m2\repository\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.12.5\jackson-datatype-jdk8-2.12.5.jar;C:\Users\Admin\.m2\repository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.12.5\jackson-datatype-jsr310-2.12.5.jar;C:\Users\Admin\.m2\repository\com\fasterxml\jackson\module\jackson-module-parameter-names\2.12.5\jackson-module-parameter-names-2.12.5.jar;C:\Users\Admin\.m2\repository\org\springframework\spring-web\5.3.10\spring-web-5.3.10.jar;C:\Users\Admin\.m2\repository\org\springframework\spring-webmvc\5.3.10\spring-webmvc-5.3.10.jar;C:\Users\Admin\.m2\repository\javax\ws\rs\javax.ws.rs-api\2.1.1\javax.ws.rs-api-2.1.1.jar;C:\Users\Admin\.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.12.5\jackson-annotations-2.12.5.jar;C:\Users\Admin\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.12.5\jackson-core-2.12.5.jar;C:\Users\Admin\.m2\repository\io\jsonwebtoken\jjwt\0.9.1\jjwt-0.9.1.jar;C:\Users\Admin\.m2\repository\org\springframework\spring-jdbc\5.3.9\spring-jdbc-5.3.9.jar;C:\Users\Admin\.m2\repository\org\springframework\spring-beans\5.3.10\spring-beans-5.3.10.jar;C:\Users\Admin\.m2\repository\org\springframework\spring-tx\5.3.10\spring-tx-5.3.10.jar;C:\Users\Admin\.m2\repository\com\zaxxer\HikariCP\3.4.5\HikariCP-3.4.5.jar;C:\Users\Admin\.m2\repository\org\slf4j\slf4j-api\1.7.32\slf4j-api-1.7.32.jar;C:\Users\Admin\.m2\repository\mysql\mysql-connector-java\8.0.16\mysql-connector-java-8.0.16.jar;C:\Users\Admin\.m2\repository\com\google\code\gson\gson\2.8.2\gson-2.8.2.jar;C:\Users\Admin\.m2\repository\io\swagger\swagger-annotations\1.6.2\swagger-annotations-1.6.2.jar com.example.piratedmovieweb.PiratedMovieWebApplication

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v2.5.5)

2021-11-08 21:09:15.272  INFO 11796 --- [  restartedMain] c.e.p.PiratedMovieWebApplication         : Starting PiratedMovieWebApplication using Java 11.0.12 on DESKTOP-OFQLT9I with PID 11796 (C:\Users\Admin\Desktop\PiratedMovieWeb\target\classes started by Admin in C:\Users\Admin\Desktop\PiratedMovieWeb)
2021-11-08 21:09:15.273  INFO 11796 --- [  restartedMain] c.e.p.PiratedMovieWebApplication         : No active profile set, falling back to default profiles: default
2021-11-08 21:09:15.307  INFO 11796 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2021-11-08 21:09:15.307  INFO 11796 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
2021-11-08 21:09:15.717  INFO 11796 --- [  restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2021-11-08 21:09:15.732  INFO 11796 --- [  restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 9 ms. Found 0 JPA repository interfaces.
2021-11-08 21:09:15.910 DEBUG 11796 --- [  restartedMain] com.zaxxer.hikari.HikariConfig           : Driver class com.mysql.cj.jdbc.Driver found in Thread context class loader org.springframework.boot.devtools.restart.classloader.RestartClassLoader@13c357f2
2021-11-08 21:09:15.977 DEBUG 11796 --- [  restartedMain] com.zaxxer.hikari.HikariConfig           : HikariPool-1 - configuration:
2021-11-08 21:09:15.979 DEBUG 11796 --- [  restartedMain] com.zaxxer.hikari.HikariConfig           : allowPoolSuspension.............false
2021-11-08 21:09:15.979 DEBUG 11796 --- [  restartedMain] com.zaxxer.hikari.HikariConfig           : autoCommit......................true
2021-11-08 21:09:15.979 DEBUG 11796 --- [  restartedMain] com.zaxxer.hikari.HikariConfig           : catalog.........................none
2021-11-08 21:09:15.979 DEBUG 11796 --- [  restartedMain] com.zaxxer.hikari.HikariConfig           : connectionInitSql...............none
2021-11-08 21:09:15.979 DEBUG 11796 --- [  restartedMain] com.zaxxer.hikari.HikariConfig           : connectionTestQuery.............none
2021-11-08 21:09:15.979 DEBUG 11796 --- [  restartedMain] com.zaxxer.hikari.HikariConfig           : connectionTimeout...............30000
2021-11-08 21:09:15.979 DEBUG 11796 --- [  restartedMain] com.zaxxer.hikari.HikariConfig           : dataSource......................none
2021-11-08 21:09:15.979 DEBUG 11796 --- [  restartedMain] com.zaxxer.hikari.HikariConfig           : dataSourceClassName.............none
2021-11-08 21:09:15.980 DEBUG 11796 --- [  restartedMain] com.zaxxer.hikari.HikariConfig           : dataSourceJNDI..................none
2021-11-08 21:09:15.980 DEBUG 11796 --- [  restartedMain] com.zaxxer.hikari.HikariConfig           : dataSourceProperties............{password=<masked>}
2021-11-08 21:09:15.980 DEBUG 11796 --- [  restartedMain] com.zaxxer.hikari.HikariConfig           : driverClassName................."com.mysql.cj.jdbc.Driver"
2021-11-08 21:09:15.980 DEBUG 11796 --- [  restartedMain] com.zaxxer.hikari.HikariConfig           : exceptionOverrideClassName......none
2021-11-08 21:09:15.980 DEBUG 11796 --- [  restartedMain] com.zaxxer.hikari.HikariConfig           : healthCheckProperties...........{}
2021-11-08 21:09:15.980 DEBUG 11796 --- [  restartedMain] com.zaxxer.hikari.HikariConfig           : healthCheckRegistry.............none
2021-11-08 21:09:15.980 DEBUG 11796 --- [  restartedMain] com.zaxxer.hikari.HikariConfig           : idleTimeout.....................600000
2021-11-08 21:09:15.980 DEBUG 11796 --- [  restartedMain] com.zaxxer.hikari.HikariConfig           : initializationFailTimeout.......1
2021-11-08 21:09:15.980 DEBUG 11796 --- [  restartedMain] com.zaxxer.hikari.HikariConfig           : isolateInternalQueries..........false
2021-11-08 21:09:15.980 DEBUG 11796 --- [  restartedMain] com.zaxxer.hikari.HikariConfig           : jdbcUrl.........................jdbc:mysql://localhost:3306/piratedmovie?allowPublicKeyRetrieval=true&useSSL=false
2021-11-08 21:09:15.981 DEBUG 11796 --- [  restartedMain] com.zaxxer.hikari.HikariConfig           : leakDetectionThreshold..........0
2021-11-08 21:09:15.981 DEBUG 11796 --- [  restartedMain] com.zaxxer.hikari.HikariConfig           : maxLifetime.....................1800000
2021-11-08 21:09:15.981 DEBUG 11796 --- [  restartedMain] com.zaxxer.hikari.HikariConfig           : maximumPoolSize.................5
2021-11-08 21:09:15.981 DEBUG 11796 --- [  restartedMain] com.zaxxer.hikari.HikariConfig           : metricRegistry..................none
2021-11-08 21:09:15.981 DEBUG 11796 --- [  restartedMain] com.zaxxer.hikari.HikariConfig           : metricsTrackerFactory...........none
2021-11-08 21:09:15.981 DEBUG 11796 --- [  restartedMain] com.zaxxer.hikari.HikariConfig           : minimumIdle.....................5
2021-11-08 21:09:15.981 DEBUG 11796 --- [  restartedMain] com.zaxxer.hikari.HikariConfig           : password........................<masked>
2021-11-08 21:09:15.981 DEBUG 11796 --- [  restartedMain] com.zaxxer.hikari.HikariConfig           : poolName........................"HikariPool-1"
2021-11-08 21:09:15.981 DEBUG 11796 --- [  restartedMain] com.zaxxer.hikari.HikariConfig           : readOnly........................false
2021-11-08 21:09:15.981 DEBUG 11796 --- [  restartedMain] com.zaxxer.hikari.HikariConfig           : registerMbeans..................false
2021-11-08 21:09:15.981 DEBUG 11796 --- [  restartedMain] com.zaxxer.hikari.HikariConfig           : scheduledExecutor...............none
2021-11-08 21:09:15.981 DEBUG 11796 --- [  restartedMain] com.zaxxer.hikari.HikariConfig           : schema..........................none
2021-11-08 21:09:15.981 DEBUG 11796 --- [  restartedMain] com.zaxxer.hikari.HikariConfig           : threadFactory...................internal
2021-11-08 21:09:15.981 DEBUG 11796 --- [  restartedMain] com.zaxxer.hikari.HikariConfig           : transactionIsolation............default
2021-11-08 21:09:15.981 DEBUG 11796 --- [  restartedMain] com.zaxxer.hikari.HikariConfig           : username........................"root"
2021-11-08 21:09:15.981 DEBUG 11796 --- [  restartedMain] com.zaxxer.hikari.HikariConfig           : validationTimeout...............5000
2021-11-08 21:09:15.981  INFO 11796 --- [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
2021-11-08 21:09:16.078 DEBUG 11796 --- [  restartedMain] com.zaxxer.hikari.pool.HikariPool        : HikariPool-1 - Added connection com.mysql.cj.jdbc.ConnectionImpl@405e1d52
2021-11-08 21:09:16.080  INFO 11796 --- [  restartedMain] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.
2021-11-08 21:09:16.141  INFO 11796 --- [  restartedMain] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [name: default]
2021-11-08 21:09:16.180  INFO 11796 --- [  restartedMain] org.hibernate.Version                    : HHH000412: Hibernate ORM core version 5.4.32.Final
2021-11-08 21:09:16.182 DEBUG 11796 --- [l-1 housekeeper] com.zaxxer.hikari.pool.HikariPool        : HikariPool-1 - Pool stats (total=1, active=0, idle=1, waiting=0)
2021-11-08 21:09:16.189 DEBUG 11796 --- [onnection adder] com.zaxxer.hikari.pool.HikariPool        : HikariPool-1 - Added connection com.mysql.cj.jdbc.ConnectionImpl@56b5de06
2021-11-08 21:09:16.193 DEBUG 11796 --- [onnection adder] com.zaxxer.hikari.pool.HikariPool        : HikariPool-1 - Added connection com.mysql.cj.jdbc.ConnectionImpl@1788d43d
2021-11-08 21:09:16.197 DEBUG 11796 --- [onnection adder] com.zaxxer.hikari.pool.HikariPool        : HikariPool-1 - Added connection com.mysql.cj.jdbc.ConnectionImpl@26d5246a
2021-11-08 21:09:16.202 DEBUG 11796 --- [onnection adder] com.zaxxer.hikari.pool.HikariPool        : HikariPool-1 - Added connection com.mysql.cj.jdbc.ConnectionImpl@77a72b72
2021-11-08 21:09:16.202 DEBUG 11796 --- [onnection adder] com.zaxxer.hikari.pool.HikariPool        : HikariPool-1 - After adding stats (total=5, active=0, idle=5, waiting=0)
2021-11-08 21:09:16.284  INFO 11796 --- [  restartedMain] o.hibernate.annotations.common.Version   : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
2021-11-08 21:09:16.362  INFO 11796 --- [  restartedMain] org.hibernate.dialect.Dialect            : HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
2021-11-08 21:09:16.746  INFO 11796 --- [  restartedMain] o.h.e.t.j.p.i.JtaPlatformInitiator       : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2021-11-08 21:09:16.752  INFO 11796 --- [  restartedMain] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2021-11-08 21:09:16.872  INFO 11796 --- [  restartedMain] o.s.b.d.a.OptionalLiveReloadServer       : LiveReload server is running on port 35729
2021-11-08 21:09:16.890  INFO 11796 --- [  restartedMain] c.e.p.PiratedMovieWebApplication         : Started PiratedMovieWebApplication in 1.93 seconds (JVM running for 2.75)
2021-11-08 21:09:16.898  INFO 11796 --- [ionShutdownHook] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2021-11-08 21:09:16.901  INFO 11796 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown initiated...
2021-11-08 21:09:16.901 DEBUG 11796 --- [ionShutdownHook] com.zaxxer.hikari.pool.HikariPool        : HikariPool-1 - Before shutdown stats (total=5, active=0, idle=5, waiting=0)
2021-11-08 21:09:16.902 DEBUG 11796 --- [nnection closer] com.zaxxer.hikari.pool.PoolBase          : HikariPool-1 - Closing connection com.mysql.cj.jdbc.ConnectionImpl@405e1d52: (connection evicted)
2021-11-08 21:09:16.904 DEBUG 11796 --- [nnection closer] com.zaxxer.hikari.pool.PoolBase          : HikariPool-1 - Closing connection com.mysql.cj.jdbc.ConnectionImpl@56b5de06: (connection evicted)
2021-11-08 21:09:16.904 DEBUG 11796 --- [nnection closer] com.zaxxer.hikari.pool.PoolBase          : HikariPool-1 - Closing connection com.mysql.cj.jdbc.ConnectionImpl@1788d43d: (connection evicted)
2021-11-08 21:09:16.904 DEBUG 11796 --- [nnection closer] com.zaxxer.hikari.pool.PoolBase          : HikariPool-1 - Closing connection com.mysql.cj.jdbc.ConnectionImpl@26d5246a: (connection evicted)
2021-11-08 21:09:16.905 DEBUG 11796 --- [nnection closer] com.zaxxer.hikari.pool.PoolBase          : HikariPool-1 - Closing connection com.mysql.cj.jdbc.ConnectionImpl@77a72b72: (connection evicted)
2021-11-08 21:09:16.905 DEBUG 11796 --- [ionShutdownHook] com.zaxxer.hikari.pool.HikariPool        : HikariPool-1 - After shutdown stats (total=0, active=0, idle=0, waiting=0)
2021-11-08 21:09:16.905  INFO 11796 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown completed.

Process finished with exit code 0

我将属性文件配置如下,并且可以通过正常使用单元测试来获得数据查询:

# =============Database config==================
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/piratedmovie?allowPublicKeyRetrieval=true&useSSL=false
spring.datasource.username=root
spring.datasource.password=123456_
spring.datasource.hikari.maximum-pool-size=5
# ==============JPA / HIBERNATE=================
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect
spring.jpa.generate-ddl=true

spring.main.web-application-type=none

logging.level.com.zaxxer.hikari.HikariConfig=DEBUG 
logging.level.com.zaxxer.hikari=TRACE

任何人都可以为我提供解决此问题的解决方案。谢谢

共有1个答案

傅啸
2023-03-14

当您指定<code>spring.main时。web应用程序type=none告诉Boot不要启动嵌入式servlet容器。因此,应用程序初始化、启动,然后关闭。注释掉这个属性,它应该开始暴露出任何其他问题。

 类似资料:
  • 我在我的项目中使用带有MongoDb和Elasticsearch的Springboot。当我的Elasticsearch服务器运行时,我的Springboot应用程序运行良好,但当Elasticsearch服务器停止时,我的Springboot应用程序也无法启动。根据我的项目要求,即使Elasticsearch服务器无法启动,我们的Springboot应用程序仍应运行,因为我们的大多数API都是基

  • 我正在开发一个spring启动应用程序并编写一些junit测试。 但我发现,当我运行任何测试时,tomcat也会启动,这使得这些测试非常缓慢,浪费了很多时间。 当我开发一个SpringMvc应用程序时,junit测试可以在不启动tomcat的情况下运行,这节省了很多时间。 所以,我想问它在那里无论如何要运行启动tomcat的springstart测试?

  • 我的条形码阅读器(Windows Embedded Compact 7)的或功能有问题。在这种情况下,我只能form。 我试图将显示为对话框,但在我单击关闭按钮(隐藏此表单并返回)后,我的所有应用程序都关闭了 在表格1(主要部分)中: 在Form2中:

  • 我想关闭/终止/扔掉一个由一行代码创建的JPanel(因此它被完全终止,而不仅仅是隐藏并在后台作为

  • 问题内容: 我用的是需要挂钩的BabelJS(原名6to5)与运行节点的应用程序es6features: 我打电话来运行我的 app.js6 。我需要安装BabelJS并为我想使用es6features的每个项目提供一个 run.js。 我希望打个电话。如何独立实现该系统(Unix和Windows)? 问题答案: 将and (又名ES6)依赖项添加到应用程序的package.json文件中,并定义

  • 我使用创建了一个应用程序构建文件。这将用和文件填充文件夹。 我在internet上进行了搜索,发现可以使用运行这些文件。不幸的是,这会产生以下错误输出: org.springframework.beans.factory.BeanCreationException:创建名为“org.springframework.boot.autocigure.orm.jpa.hibernatejpaAutoCo