Skip to content

spring boot Tomcat

I have created one simple spring boot application and have added 2 dependencies using spring initializers, H2 and JPA. I have added H2 configuration in file and then added hoteldata.sql file in resource folder. When i am running the project, spring boot log doesn’t show Tomcat is started.

I am expecting below log to be displayed while starting the spring boot application,

main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8081 (http)
2020-12-06 18:16:26.350  INFO [userms,,,] 9144 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2020-12-06 18:16:26.351  INFO [userms,,,] 9144 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.37]
2020-12-06 18:16:27.085  INFO [userms,,,] 9144 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext

but it is not appearing..

When i am hitting the endpoint, http://localhost:8081/h2-console nothing is happening..

Did i miss anything at configuration level ?



Finally, I have solved this problem. Along with H2 and JPA dependency, we need to add ‘spring boot starter web’ dependency as well .It helps to start inbuilt Tomcat in spring boot application.