Create a Spring Boot project in intellij and exit immediately after launching

I was thinking of starting Spring Boot with IntelliJ, It was when I stumbled upon creating and running a project.

Symptoms

When I created a project in IntelliJ using Spring Inirializer and ran Run Application from main, the application quit immediately.

2018-03-13 20:45:42.270  INFO 7595 --- [      Thread-12] o.s.j.e.a.AnnotationMBeanExporter        : Unregistering JMX-exposed beans on shutdown

Process finished with exit code 0

Running from eclipse works fine, and running from gradle also works. .. .. For some reason it doesn't start from Run Application from IntelliJ. .. ..

Solution

It started by changing the dependency configuration of spring-boot-starter-tomcat in the dependencies of build.gradle from providedRuntime to compile.

build.gradle


dependencies {
	compile('org.springframework.boot:spring-boot-starter-web')
	// providedRuntime('org.springframework.boot:spring-boot-starter-tomcat')
	compile('org.springframework.boot:spring-boot-starter-tomcat')
	testCompile('org.springframework.boot:spring-boot-starter-test')
}

Impressions

There are people who are addicted to the same thing. Spring Boot app shuts down automatically

However, considering the actual operation, it seems better not to change the dependency configuration of spring-boot-starter-tomcat. Execute bootRun with gradle from IntelliJ to proceed with development. You can also debug.

Recommended Posts

Create a Spring Boot project in intellij and exit immediately after launching
How to create a Spring Boot project in IntelliJ
Create Java Spring Boot project in IntelliJ
Until you create a Spring Boot project in Intellij and push it to Github
Launch (old) Spring Boot project in IntelliJ
Run a Spring Boot project in VS Code
Create a Spring Boot application using IntelliJ IDEA
Java tips-Create a Spring Boot project in Gradle
Create a portfolio app using Java and Spring Boot
[Spring Boot] How to create a project (for beginners)
How to create a new Gradle + Java + Jar project in Intellij 2016.03
Create a Spring Boot app development project with the cURL + tar command
Creating a project (and GitHub repository) using Java and Gradle in IntelliJ IDEA
A story about a Spring Boot project written in Java that supports Kotlin
Create a simple search app with Spring Boot
Output request and response log in Spring Boot
Run JUnit and Spock in a maven project
How to add a classpath in Spring Boot
Create a web api server with spring boot
View the Gradle task in the Spring Boot project
Create a Spring Boot development environment with docker
I made a Restful server and client in Spring.
Create a simple demo site with Spring Security with Spring Boot 2.1
Try gRPC in Spring Boot & Spring Cloud project (Mac OS)
Create a base for your batch processing project in Eclipse.
A story about BeanNotOfRequiredTypeException occurring after applying AOP in Spring
How to call and use API in Java (Spring Boot)
Create API to send and receive Json data in Spring
Create a tomcat project using Eclipse Pleiades All in One
Get error information using DefaultErrorAttributes and ErrorAttributeOptions in Spring Boot 2.3
I haven't understood after touching Spring Boot for a month
Create a Spring Boot web app that uses IBM Cloudant and deploy it to Cloud Foundry
Set context-param in Spring Boot
Spring Boot 2 multi-project in Gradle
Major changes in Spring Boot 1.5
NoHttpResponseException in Spring Boot + WireMock
Create microservices with Spring Boot
Create a private repository in Amazon ECR and push/pull the image
RSocket is supported in Spring Boot 2.2, so give it a try
How to make a hinadan for a Spring Boot project using SPRING INITIALIZR
I can't create a Java class with a specific name in IntelliJ
Get a proxy instance of the component itself in Spring Boot
[Swift] Create a project with Xcode (ver 12.1) and display "Hello, World!"
Uploading and downloading files using Ajax in Spring Boot (without JQuery)
Fitted in Spring Boot using a bean definition file named application.xml
Compare Hello, world! In Spring Boot with Java, Kotlin and Groovy
Install Rails in the development environment and create a new application
Let's write a test code for login function in Spring Boot
How to display characters entered in Spring Boot on a browser and reference links [Introduction to Spring Boot / For beginners]