I try to create Spring boot application using spring initializer. I just created new app using dependencies
<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>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
but when ever I try to start the application It just shut down. I have created controller and also follow all the solution like: changing port or removing tomcat from .m2 folder but nothing works. these are my logs
2021-04-30 02:50:10,845 INFO [main] org.hibernate.dialect.Dialect: HHH000400: Using dialect: org.hibernate.dialect.H2Dialect
2021-04-30 02:50:12,067 INFO [main] org.hibernate.engine.transaction.jta.platform.internal.JtaPlatformInitiator: HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2021-04-30 02:50:12,087 INFO [main] org.springframework.orm.jpa.AbstractEntityManagerFactoryBean: Initialized JPA EntityManagerFactory for persistence unit 'default'
2021-04-30 02:50:12,914 INFO [main] org.springframework.boot.StartupInfoLogger: Started WebApplication in 7.549 seconds (JVM running for 8.848)
2021-04-30 02:50:13,025 INFO [SpringContextShutdownHook] org.springframework.orm.jpa.AbstractEntityManagerFactoryBean: Closing JPA EntityManagerFactory for persistence unit 'default'
2021-04-30 02:50:13,027 INFO [SpringContextShutdownHook] org.hibernate.tool.schema.internal.SchemaDropperImpl$DelayedDropActionImpl: HHH000477: Starting delayed evictData of schema as part of SessionFactory shut-down'
2021-04-30 02:50:13,037 INFO [SpringContextShutdownHook] com.zaxxer.hikari.HikariDataSource: HikariPool-1 - Shutdown initiated...
2021-04-30 02:50:13,045 INFO [SpringContextShutdownHook] com.zaxxer.hikari.HikariDataSource: HikariPool-1 - Shutdown completed.
Process finished with exit code 0
If any one have idea whats going wrong. I am using spring boot 2.4.5 version.
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.4.5</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
It seems tomcat embedded jar is not included in the dependencies/jar. It should have pulled transitively since "spring-boot-starter-web" dependency already defined. But somehow it is excluded.
Try executing "mvn dependency:tree" and check whether the tomcat dependencies exist and in "compile" scope