Please tell me how to create a SpringBoot project that works with Tomcat 8.5.

Asked 2 years ago, Updated 2 years ago, 84 views

I would like to create an application that works with a specific Tomcat in Spring Boot starter.

I installed Eclipse and created a new project with SpringBootStarter, but by default Eclipse 9.0 is embedded and
I can't seem to implement a different version.

When I changed pom.xml to the following,

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<tomcat.version>8.5.32</tomcat.version>
</properties>

How do I create a Spring project that works with a specific Tomcat version in the build of the development environment when I output War/Jar?

Error Log

*********************
APPLICATION FAILED TO START
***************************

Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:175)

The following method did not exist:

spring spring-boot tomcat

2022-09-29 20:27

1 Answers

You can deploy Spring Boot applications to any servlet 3.1+ compatible container.

As stated, it can be deployed to servlet containers that support Sevlet 3.1 and later.

This is 8.0 or later for the Tomcat version.
In other words, you should be able to deploy on Tomcat 8.5 without doing anything special.

If you want the built-in Tomcat version to be 8.5, you must use Spring Boot 2.0.x.
(However, I don't think there are any situations where an older version of Tomcat is required.)

2.0.x is no longer supported.


2022-09-29 20:27

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.