-1

I try to make one simply application for exercise purpose and I download project from Spring initializr and all classes are empty (controller, entity service etc), I have create DB and add connection string in application.properties. All I wont before I proceed with code to be sure that connection on DB work. When I start application, on first look like OK, but after minute stop working. My DB is MySQLWorkbench. Any help, tips. Here is my connection string:

<!--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 -->

And here is message when he start working:

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.
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
dinko
  • 19
  • 5
  • Does this answer your question? [Spring boot "Hikari Pool Shutdown" early error](https://stackoverflow.com/questions/53259267/spring-boot-hikari-pool-shutdown-early-error) – Eklavya Jul 12 '20 at 08:58

1 Answers1

0

I forget to tell if I remove all code from application.properties all start just fine, so something between Spring boot and MySQLWorkbench, but I don't understand what. End here is pom file:

4.0.0 org.springframework.boot spring-boot-starter-parent 2.3.1.RELEASE com.tombola tombola 0.0.1-SNAPSHOT tombola Projekt za tombolu

<properties>
    <java.version>1.8</java.version>
</properties>

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-jpa</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
    </dependency>
    <dependency>
        <groupId>com.h2database</groupId>
        <artifactId>h2</artifactId>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
        <exclusions>
            <exclusion>
                <groupId>org.junit.vintage</groupId>
                <artifactId>junit-vintage-engine</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>
dinko
  • 19
  • 5
  • Can you put back your application.properties and remove `com.h2database` dependency instead? – Kavithakaran Kanapathippillai Jul 12 '20 at 10:29
  • I have try your suggestion, put back my application.properties and remove h2 dependency, but the same error: – dinko Jul 12 '20 at 14:50
  • 2020-07-12 16:49:35.873 INFO 6956 --- [extShutdownHook] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default' 2020-07-12 16:49:35.873 INFO 6956 --- [extShutdownHook] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor' 2020-07-12 16:49:35.873 INFO 6956 --- [extShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated... 2020-07-12 16:49:35.893 INFO 6956 --- [extShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed. – dinko Jul 12 '20 at 14:52