您能帮忙吗?
我启动了我的应用程序,但在出现以下几秒钟的错误后它正在关闭:
2018-09-21 17:34:59,500 INFO | main | com.zaxxer.hikari.HikariDataSource 93 | springHikariCP - is starting. |
2018-09-21 17:35:29,535 INFO | main | com.zaxxer.hikari.pool.HikariPool 213 | springHikariCP - is closing down. |
2018-09-21 17:35:29,855 WARN | main | o.s.context.support.ClassPathXmlApplicationContext 551 | Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'appEntityManagerFactory' defined in class path resource [META-INF/spring/app.repositories.xml]: Invocation of init method failed; nested exception is com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Exception during pool initialization: springHikariCP - Connection is not available, request timed out after 30002ms. |
2018-09-21 17:35:29,870 ERROR | main | com.my.jos.jmx.Driver 72 | CRITICAL ERROR: Error encountered starting application. |
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'appEntityManagerFactory' defined in class path resource [META-INF/spring/app.repositories.xml]: Invocation of init method failed; nested exception is com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Exception during pool initialization: springHikariCP - Connection is not available, request timed out after 30002ms.
答案 0 :(得分:0)
如果您不需要使用HikariCP,则可以检查POM并考虑将其删除(如果已定义)。
您还可以确保使用以下依赖项:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
假设您使用的是xml配置,则可以确保正确设置数据源: