springboot启动失败,本来是可以运行的后来不知道为什么就突然跑不起来。在我同学的电脑上可以运行。查看日志最后是因为o.s.scheduling.concurrent.ThreadPoolTaskExecutor - Shutting down ExecutorService 'applicationTaskExecutor'
o.s.orm.jpa.LocalContainerEntityManagerFactoryBean - Closing JPA EntityManagerFactory for persistence unit 'default'
com.alibaba.druid.pool.DruidDataSource - {dataSource-1} closed
从启动到关闭,一气呵成。日志看不出什么实在是没思路
|\ |\ \ |\ |\ _ \ _ |\ _ \ _
\ \ \\ \ \ \ \ \ \__\ \ \ \ \__\ \
\ \ __ \ __ \ \ \ \ \|| \ \ \ \|| \
\ \ \ \ |\ \_\ \ \ \ \ \ \ \ \ \ \
\ __\ __\ ___\ __\ \ __\ __\ \ __
|||||_||| |||| |__|
[breadroll-mall] 2022-12-06 09:53:56.569 [main] INFO com.qiu.BreadRollMallServer - Starting BreadRollMallServer on LAPTOP-TKRK9L7E with PID 16472 (started by Acer in D:\下载\steamed-bread-roll-project-master\steamed-bread-roll-project-master\breadroll-mall-server)
[breadroll-mall] 2022-12-06 09:53:56.572 [main] INFO com.qiu.BreadRollMallServer - The following profiles are active: redis,mail,jdbc
[breadroll-mall] 2022-12-06 09:53:57.713 [main] INFO o.s.d.r.config.RepositoryConfigurationDelegate - Multiple Spring Data modules found, entering strict repository configuration mode!
[breadroll-mall] 2022-12-06 09:53:57.713 [main] INFO o.s.d.r.config.RepositoryConfigurationDelegate - Bootstrapping Spring Data repositories in DEFAULT mode.
[breadroll-mall] 2022-12-06 09:53:57.816 [main] INFO o.s.d.r.config.RepositoryConfigurationDelegate - Finished Spring Data repository scanning in 86ms. Found 0 repository interfaces.
[breadroll-mall] 2022-12-06 09:53:57.834 [main] INFO o.s.d.r.config.RepositoryConfigurationDelegate - Multiple Spring Data modules found, entering strict repository configuration mode!
[breadroll-mall] 2022-12-06 09:53:57.836 [main] INFO o.s.d.r.config.RepositoryConfigurationDelegate - Bootstrapping Spring Data repositories in DEFAULT mode.
[breadroll-mall] 2022-12-06 09:53:57.916 [main] INFO o.s.d.r.config.RepositoryConfigurationDelegate - Finished Spring Data repository scanning in 65ms. Found 0 repository interfaces.
[breadroll-mall] 2022-12-06 09:53:58.320 [main] INFO c.u.j.c.EnableEncryptablePropertiesBeanFactoryPostProcessor - Post-processing PropertySource instances
[breadroll-mall] 2022-12-06 09:53:58.391 [main] INFO c.u.j.EncryptablePropertySourceConverter - Converting PropertySource configurationProperties [org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertySource] to AOP Proxy
[breadroll-mall] 2022-12-06 09:53:58.392 [main] INFO c.u.j.EncryptablePropertySourceConverter - Converting PropertySource servletConfigInitParams [org.springframework.core.env.PropertySource$StubPropertySource] to EncryptablePropertySourceWrapper
[breadroll-mall] 2022-12-06 09:53:58.392 [main] INFO c.u.j.EncryptablePropertySourceConverter - Converting PropertySource servletContextInitParams [org.springframework.core.env.PropertySource$StubPropertySource] to EncryptablePropertySourceWrapper
[breadroll-mall] 2022-12-06 09:53:58.393 [main] INFO c.u.j.EncryptablePropertySourceConverter - Converting PropertySource systemProperties [org.springframework.core.env.PropertiesPropertySource] to EncryptableMapPropertySourceWrapper
[breadroll-mall] 2022-12-06 09:53:58.394 [main] INFO c.u.j.EncryptablePropertySourceConverter - Converting PropertySource systemEnvironment [org.springframework.boot.env.SystemEnvironmentPropertySourceEnvironmentPostProcessor$OriginAwareSystemEnvironmentPropertySource] to EncryptableSystemEnvironmentPropertySourceWrapper
[breadroll-mall] 2022-12-06 09:53:58.394 [main] INFO c.u.j.EncryptablePropertySourceConverter - Converting PropertySource random [org.springframework.boot.env.RandomValuePropertySource] to EncryptablePropertySourceWrapper
[breadroll-mall] 2022-12-06 09:53:58.394 [main] INFO c.u.j.EncryptablePropertySourceConverter - Converting PropertySource applicationConfig: [classpath:/application-jdbc.yml] [org.springframework.boot.env.OriginTrackedMapPropertySource] to EncryptableMapPropertySourceWrapper
[breadroll-mall] 2022-12-06 09:53:58.394 [main] INFO c.u.j.EncryptablePropertySourceConverter - Converting PropertySource applicationConfig: [classpath:/application-mail.yml] [org.springframework.boot.env.OriginTrackedMapPropertySource] to EncryptableMapPropertySourceWrapper
[breadroll-mall] 2022-12-06 09:53:58.394 [main] INFO c.u.j.EncryptablePropertySourceConverter - Converting PropertySource applicationConfig: [classpath:/application-redis.yml] [org.springframework.boot.env.OriginTrackedMapPropertySource] to EncryptableMapPropertySourceWrapper
[breadroll-mall] 2022-12-06 09:53:58.394 [main] INFO c.u.j.EncryptablePropertySourceConverter - Converting PropertySource applicationConfig: [classpath:/application.yml] [org.springframework.boot.env.OriginTrackedMapPropertySource] to EncryptableMapPropertySourceWrapper
[breadroll-mall] 2022-12-06 09:53:58.469 [main] INFO c.u.j.filter.DefaultLazyPropertyFilter - Property Filter custom Bean not found with name 'encryptablePropertyFilter'. Initializing Default Property Filter
[breadroll-mall] 2022-12-06 09:53:58.591 [main] INFO o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$2a6d89e3] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[breadroll-mall] 2022-12-06 09:53:58.862 [main] INFO c.u.j.resolver.DefaultLazyPropertyResolver - Property Resolver custom Bean not found with name 'encryptablePropertyResolver'. Initializing Default Property Resolver
[breadroll-mall] 2022-12-06 09:53:58.866 [main] INFO c.u.j.detector.DefaultLazyPropertyDetector - Property Detector custom Bean not found with name 'encryptablePropertyDetector'. Initializing Default Property Detector
[breadroll-mall] 2022-12-06 09:53:59.085 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat initialized with port(s): 9999 (http)
[breadroll-mall] 2022-12-06 09:53:59.112 [main] INFO org.apache.coyote.http11.Http11NioProtocol - Initializing ProtocolHandler ["http-nio-9999"]
[breadroll-mall] 2022-12-06 09:53:59.134 [main] INFO org.apache.catalina.core.StandardService - Starting service [Tomcat]
[breadroll-mall] 2022-12-06 09:53:59.134 [main] INFO org.apache.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/9.0.24]
[breadroll-mall] 2022-12-06 09:53:59.470 [main] INFO o.a.c.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext
[breadroll-mall] 2022-12-06 09:53:59.471 [main] INFO org.springframework.web.context.ContextLoader - Root WebApplicationContext: initialization completed in 2842 ms
[breadroll-mall] 2022-12-06 09:53:59.822 [main] INFO com.alibaba.druid.pool.DruidDataSource - {dataSource-1} inited
[breadroll-mall] 2022-12-06 09:54:00.070 [main] INFO org.hibernate.jpa.internal.util.LogHelper - HHH000204: Processing PersistenceUnitInfo [
name: default
...]
[breadroll-mall] 2022-12-06 09:54:00.181 [main] INFO org.hibernate.Version - HHH000412: Hibernate Core {5.3.11.Final}
[breadroll-mall] 2022-12-06 09:54:00.184 [main] INFO org.hibernate.cfg.Environment - HHH000206: hibernate.properties not found
[breadroll-mall] 2022-12-06 09:54:00.392 [main] INFO org.hibernate.annotations.common.Version - HCANN000001: Hibernate Commons Annotations {5.0.4.Final}
[breadroll-mall] 2022-12-06 09:54:00.720 [main] INFO org.hibernate.dialect.Dialect - HHH000400: Using dialect: org.hibernate.dialect.MySQL57Dialect
[breadroll-mall] 2022-12-06 09:54:01.725 [main] INFO o.s.orm.jpa.LocalContainerEntityManagerFactoryBean - Initialized JPA EntityManagerFactory for persistence unit 'default'
[breadroll-mall] 2022-12-06 09:54:03.325 [main] INFO o.s.scheduling.concurrent.ThreadPoolTaskExecutor - Initializing ExecutorService 'applicationTaskExecutor'
[breadroll-mall] 2022-12-06 09:54:03.460 [main] INFO o.s.b.a.web.servlet.WelcomePageHandlerMapping - Adding welcome page: class path resource [static/index.html]
[breadroll-mall] 2022-12-06 09:54:03.989 [main] INFO org.apache.coyote.http11.Http11NioProtocol - Starting ProtocolHandler ["http-nio-9999"]
[breadroll-mall] 2022-12-06 09:54:04.026 [main] INFO o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat started on port(s): 9999 (http) with context path ''
[breadroll-mall] 2022-12-06 09:54:04.030 [main] INFO com.qiu.BreadRollMallServer - Started BreadRollMallServer in 8.151 seconds (JVM running for 9.678)
[breadroll-mall] 2022-12-06 09:54:04.033 [main] INFO com.qiu.BreadRollMallServerRunner - Executing command line runner...
[breadroll-mall] 2022-12-06 09:54:04.340 [main] INFO io.lettuce.core.EpollProvider - Starting without optional epoll library
[breadroll-mall] 2022-12-06 09:54:04.342 [main] INFO io.lettuce.core.KqueueProvider - Starting without optional kqueue library
[breadroll-mall] 2022-12-06 09:54:05.420 [main] INFO o.s.scheduling.concurrent.ThreadPoolTaskExecutor - Shutting down ExecutorService 'applicationTaskExecutor'
[breadroll-mall] 2022-12-06 09:54:06.561 [main] INFO o.s.orm.jpa.LocalContainerEntityManagerFactoryBean - Closing JPA EntityManagerFactory for persistence unit 'default'
[breadroll-mall] 2022-12-06 09:54:06.566 [main] INFO com.alibaba.druid.pool.DruidDataSource - {dataSource-1} closed
Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true
项目启动失败
找过网上的方法,缺少依赖包什么的,都没用。
求大佬解答
com.alibaba.druid.pool.DruidDataSource 是阿里巴巴的一个数据库连接池。如果出现 {dataSource-1} closed 关闭的错误,说明在 Spring Boot 启动的过程中,连接池可能已经用完了或者遇到了其他问题,导致无法创建新的数据库连接。
这种情况通常可以通过检查数据库连接池的配置,确保连接池大小足够满足需求,并且没有遇到其他错误。例如,您可以检查数据库的连接超时时间是否过短,以及是否有太多的请求在等待连接。
建议您参考 DruidDataSource 的文档,了解有关配置和使用该连接池的更多信息。
是否启动时有其它依赖服务或方法没有正常运行,导致启动失败,从而导致Spring判定启动失败,而自动关闭数据库连接?
日志级别换到debug,再看有啥有用的信息没
后台进程杀掉,重新启动