当前位置:   article > 正文

ERROR c.z.hikari.pool.HikariPool :594 restartedMain HikariPool-1 - Exception 问题_error c.z.h.p.hikaripool - [throwpoolinitializatio

error c.z.h.p.hikaripool - [throwpoolinitializationexception,594] - hikaripo

 【问题描述】:启动SpringBoot项目时,报如下堆栈错误

  1. 32.014 ERROR c.z.hikari.pool.HikariPool    :594  restartedMain                    HikariPool-1 - Exception during pool initialization.
  2. com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
  3. The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
  4.         at com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:174)
  5.         at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:64)
  6.         at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:833)
  7.         at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:453)
  8.         at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:246)
  9.         at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:198)
  10.         at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138)
  11.         at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:364)
  12.         at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206)
  13.         at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:476)
  14.         at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561)
  15.         at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115)
  16.         at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112)
  17.         at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:158)
  18.         at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:116)
  19.         at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:79)
  20.         at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:330)
  21.         at org.springframework.boot.jdbc.EmbeddedDatabaseConnection.isEmbedded(EmbeddedDatabaseConnection.java:184)
  22.         at org.springframework.boot.jdbc.init.DataSourceScriptDatabaseInitializer.isEmbeddedDatabase(DataSourceScriptDatabaseInitializer.java:64)
  23.         at org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer.isEnabled(AbstractScriptDatabaseInitializer.java:87)
  24.         at org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer.initializeDatabase(AbstractScriptDatabaseInitializer.java:74)
  25.         at org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer.afterPropertiesSet(AbstractScriptDatabaseInitializer.java:65)
  26.         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1845)
  27.         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1782)
  28.         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:602)
  29.         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524)
  30.         at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
  31.         at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
  32.         at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
  33.         at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
  34.         at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322)
  35.         at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
  36.         at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:944)
  37.         at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
  38.         at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
  39.         at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145)
  40.         at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754)
  41.         at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434)
  42.         at org.springframework.boot.SpringApplication.run(SpringApplication.java:338)
  43.         at com.abc.wiki.WikiApplication.main(WikiApplication.java:19)
  44.         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  45.         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  46.         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  47.         at java.lang.reflect.Method.invoke(Method.java:498)
  48.         at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
  49. Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure
  50. The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
  51.         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  52.         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
  53.         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
  54.         at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
  55.         at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61)
  56.         at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105)
  57.         at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151)
  58.         at com.mysql.cj.exceptions.ExceptionFactory.createCommunicationsException(ExceptionFactory.java:167)
  59.         at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:89)
  60.         at com.mysql.cj.NativeSession.connect(NativeSession.java:144)
  61.         at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:953)
  62.         at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:823)
  63.         ... 42 common frames omitted
  64. Caused by: java.net.ConnectException: Connection timed out: connect
  65.         at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
  66.         at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)
  67.         at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
  68.         at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
  69.         at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
  70.         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
  71.         at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
  72.         at java.net.Socket.connect(Socket.java:589)
  73.         at com.mysql.cj.protocol.StandardSocketFactory.connect(StandardSocketFactory.java:155)
  74.         at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:63)
  75.         ... 45 common frames omitted

【问题原因】:今天在本地调试项目,由于电脑连接的wifi变了,导致ip也变了,最终导致这个问题。

【解决方法】:将项目连接数据库的配置修改为新的ip地址。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/羊村懒王/article/detail/159777
推荐阅读
相关标签
  

闽ICP备14008679号