Spring Boot Application containerizes but Tomcat Server doesn't start
See original GitHub issueDescription of the issue:
- Create a Rest service w/ Spring Boot, and add Jib to Maven
pom.xml
. - Validate that local run, default port 8080 is exposed.
- Run `jib:build
- Run the created container image
- Notice the port isn’t opened. Tomcat didn’t start.
Expected behavior: Created image should behave like the JAR.
Steps to reproduce:
- Build application here: https://github.com/saturnism/spring-cloud-gcp-guestbook/tree/master/11-kubernetes/guestbook-frontend
- Build container w/ Jib.
- Notice the port isn’t opened.
Environment: MacOS, Maven
jib-maven-plugin
Configuration:
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>0.9.6</version>
<configuration>
<to>
<image>gcr.io/.../guestbook-frontend</image>
</to>
</configuration>
</plugin>
Log output: Normal Startup w/o Jib
2018-07-17 14:09:02.191 INFO [-,,,] 60312 --- [ main] o.s.i.endpoint.EventDrivenConsumer : started _org.springframework.integration.errorLogger
2018-07-17 14:09:02.485 INFO [-,,,] 60312 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2018-07-17 14:09:02.488 INFO [-,,,] 60312 --- [ main] c.example.frontend.FrontendApplication : Started FrontendApplication in 9.774 seconds (JVM running for 10.318)
Failed startup w/ Jib
springframework.integration.errorLogger} as a subscriber to the 'errorChannel' channel
2018-07-17 18:05:09.937 INFO [-,,,] 1 --- [ main] o.s.i.channel.PublishSubscribeChannel : Channel 'application-1.errorChannel' has 1 subscriber(s).
2018-07-17 18:05:09.937 INFO [-,,,] 1 --- [ main] o.s.i.endpoint.EventDrivenConsumer : started _org.springframework.integration.errorLogger
2018-07-17 18:05:09.967 INFO [-,,,] 1 --- [ main] c.example.frontend.FrontendApplication : Started FrontendApplication in 9.085 seconds (JVM running for 9.892)
Additional Information:
Issue Analytics
- State:
- Created 5 years ago
- Comments:19 (15 by maintainers)
Top Results From Across the Web
Tomcat Doesn't Come Up When Running Spring Boot ...
I have run into a bit of a strange problem. I have a Spring Boot application that listens on 8080. Here's my config:...
Read more >Dockerize a Spring Boot Application with Tomcat - Indellient Inc.
We move the WAR file (that comes from the Maven build) into the correct location and run the Tomcat server.
Read more >Deploy a Spring Boot Application into Tomcat - Okta Developer
The most popular way to start a Spring project is with Spring Initializr. Navigate to start.spring.io in your favorite web browser, then choose ......
Read more >76. Embedded Web Servers - Spring
Many Spring Boot starters include default embedded containers. For servlet stack applications, the spring-boot-starter-web includes Tomcat by including spring- ...
Read more >How to Configure Spring Boot Tomcat - Baeldung
Spring Boot web applications include a pre-configured, embedded web server by default. In some situations, though, we'd like to modify the ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ah I found it: @saturnism
The scope is set to
provided
, but should be none/compile
.Not sure why it wasn’t being added since
spring-boot-starter-web
includesspring-boot-starter-tomcat
, which includestomcat-embed-core
.