Я пытаюсь сделать одно простое приложение для упражнений, и я загружаю проект из Spring initializr, и все классы пусты (контроллер, служба сущностей и т. Д. c), я создал БД и добавил строку подключения в application.properties. Все, что я делаю, прежде чем приступить к написанию кода, чтобы убедиться, что соединение с БД работает. Когда я запускаю приложение, сначала выглядит нормально, но через минуту перестает работать. Моя БД - MySQLWorkbench. Любая помощь, подсказки. Вот моя строка подключения:
<!--spring.main.web-application-type=none -->
spring.datasource.driverClassName = com.mysql.cj.jdbc.Driver
spring.datasource.url = jdbc:mysql://localhost:3306/tombola?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
spring.datasource.username = root
spring.datasource.password = Desktop
spring.datasource.testOnBorrow = true
spring.datasource.testWhileIdle = true
spring.datasource.timeBetweenEvictionRunsMillis = 60000
spring.datasource.minEvictableIdleTimeMillis = 30000
spring.datasource.validationQuery = SELECT 1
spring.datasource.max-active = 15
spring.datasource.max-idle = 10
spring.datasource.max-wait = 8000
<!--verifyServerCertificate=false&useSSL=false&requireSSL=false -->
<!--autoreconnect = true -->
И вот сообщение, когда он начинает работать:
2020-07-12 10:46:13.600 INFO 2312 --- [ main] com.tombola.test.TombolaApplication : Starting TombolaApplication on Desktop-PC with PID 2312 (C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.3\workspace\tombola\target\classes started by Desktop in C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.3\workspace\tombola)
2020-07-12 10:46:13.600 INFO 2312 --- [ main] com.tombola.test.TombolaApplication : No active profile set, falling back to default profiles: default
2020-07-12 10:46:14.630 INFO 2312 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFERRED mode.
2020-07-12 10:46:14.786 INFO 2312 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 143ms. Found 0 JPA repository interfaces.
2020-07-12 10:46:15.628 INFO 2312 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2020-07-12 10:46:15.644 INFO 2312 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2020-07-12 10:46:16.377 INFO 2312 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2020-07-12 10:46:16.876 INFO 2312 --- [ task-1] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]
2020-07-12 10:46:17.391 INFO 2312 --- [ task-1] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.4.17.Final
2020-07-12 10:46:17.562 INFO 2312 --- [ task-1] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.0.Final}
2020-07-12 10:46:17.625 INFO 2312 --- [ main] DeferredRepositoryInitializationListener : Triggering deferred initialization of Spring Data repositories…
2020-07-12 10:46:17.625 INFO 2312 --- [ main] DeferredRepositoryInitializationListener : Spring Data repositories initialized!
2020-07-12 10:46:17.656 INFO 2312 --- [ main] com.tombola.test.TombolaApplication : Started TombolaApplication in 6.269 seconds (JVM running for 8.829)
2020-07-12 10:46:17.984 INFO 2312 --- [ task-1] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect
2020-07-12 10:46:18.405 INFO 2312 --- [ task-1] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2020-07-12 10:46:18.405 INFO 2312 --- [ task-1] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2020-07-12 10:47:18.435 INFO 2312 --- [extShutdownHook] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2020-07-12 10:47:18.466 INFO 2312 --- [extShutdownHook] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor'
2020-07-12 10:47:18.466 INFO 2312 --- [extShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2020-07-12 10:47:18.606 INFO 2312 --- [extShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.