Spring Boot stop immediately after start up
Hi there,
I am encountering an issue when running a Spring Boot 2 + Kotlin.
IntelliJ Version
IntelliJ IDEA 2020.1.2 (Ultimate Edition)
Build #IU-201.7846.76, built on May 31, 2020
Licensed to ATB Financial / Cheng Xu
Subscription is active until October 18, 2020
Runtime version: 11.0.7+10-b765.53 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 10.15.5
GC: ParNew, ConcurrentMarkSweep
Memory: 1981M
Cores: 8
Registry: debugger.watches.in.variables=false
Non-Bundled Plugins: EclipseCodeFormatter, JMeter plugin, Lombook Plugin, PMDPlugin, com.github.kisstkondoros.codemetrics, org.intellij.RegexpTester, Dart, io.flutter, org.jetbrains.kotlin, MetricsReloaded
Symptom:
The project runs fine in command line via `gradle bootRun`. However, it stops immediately after start up if I ran it from IntelliJ.
```
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.3.1.RELEASE)
2020-07-01 00:19:10.764 INFO 61354 --- [ restartedMain] com.pinngo.auth.AppKt : Starting AppKt on m0165291000.lan with PID 61354 (/Users/e87935/dev/pin/services/user/out/production/classes started by e87935 in /Users/e87935/dev/pin/services/user)
2020-07-01 00:19:10.767 INFO 61354 --- [ restartedMain] com.pinngo.auth.AppKt : The following profiles are active: local
2020-07-01 00:19:10.855 INFO 61354 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2020-07-01 00:19:11.509 INFO 61354 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2020-07-01 00:19:11.562 INFO 61354 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 43ms. Found 1 JPA repository interfaces.
2020-07-01 00:19:12.424 INFO 61354 --- [ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2020-07-01 00:19:12.533 INFO 61354 --- [ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2020-07-01 00:19:12.581 INFO 61354 --- [ restartedMain] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]
2020-07-01 00:19:12.633 INFO 61354 --- [ restartedMain] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.4.17.Final
2020-07-01 00:19:12.848 INFO 61354 --- [ restartedMain] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.0.Final}
2020-07-01 00:19:12.993 INFO 61354 --- [ restartedMain] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.PostgreSQL10Dialect
2020-07-01 00:19:13.450 INFO 61354 --- [ restartedMain] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2020-07-01 00:19:13.458 INFO 61354 --- [ restartedMain] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2020-07-01 00:19:14.261 INFO 61354 --- [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729
2020-07-01 00:19:14.291 INFO 61354 --- [ restartedMain] com.pinngo.auth.AppKt : Started AppKt in 3.963 seconds (JVM running for 4.894)
2020-07-01 00:19:14.299 INFO 61354 --- [extShutdownHook] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2020-07-01 00:19:14.302 INFO 61354 --- [extShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2020-07-01 00:19:14.308 INFO 61354 --- [extShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
```
What have I tried?
- Define a controller
- Include `implementation("org.springframework.boot:spring-boot-starter-web")`
But it doesn't prevent the issue from happening.
Please help. Thanks!
Please sign in to leave a comment.
Unfortunately, there is no clear reason in the attached output. May I ask you to upload a compressed log folder and a small sample project in which the problem is reproducible? Does it work fine in the empty project created from the Spring Initializr menu?
Here are similar issues on StackOverflow:
Egor Klepikov Started a new Kotlin Spring Boot project from scratch and pull in the changes step by step. It works fine this time.
Thanks for the information. If the problem remains please attach a compressed log folder and a sample project for future investigation.