Hello, i was trying to deploy a spring boot application to a tomcat server something like this tutorial : https://www.springcloud.io/post/2022-09/springboot-tomcat/#gsc.tab=0
the tutorial was just an example, my goal was to deploy an application to a tomcat server. I did a lot of testing and it seems
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.2</version> ------ HEREE
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.javatpoint</groupId>
<artifactId>spring-boot-war-deployment-example</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>spring-boot-war-deployment-example</name>
<description>Demo project for Spring Boot</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>17</java.version> ----HERE
</properties>
something happen with the version 3.2.2 not sure yet if happen in more
but after my application is deployed to the tomcat server
it is not founding the application and it is there on the application tomcat server
if we change the parent version to i tested with <version>2.2.2.RELEASE</version>
and change the java.version to 1.8
after deploy the app to the tomcat
if we try to hit the endpoint
i have 2 classes
@SpringBootApplication
public class Demo4Application extends SpringBootServletInitializer
{
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application)
{
return application.sources(Demo4Application.class);
}
public static void main(String[] args) {
SpringApplication.run(Demo4Application.class, args);
}
}
java
@RestController
public class DemoRestController
{
@GetMapping("/hello")
public String hello()
{
return "Hello User, have a nice day.";
}
}
After more testing is seems that this behavior started on
<version>3.0.0</version>
anything below from that still working any help is appreciate thanks.
Comment From: philwebb
It's not east to tell if this is a bug or something in your configuration. As a guess, I suspect that you might be using an incompatible version of Tomcat (the blog you are following is using Tomcat 9). You'll want to upgrade to 10 if that's the case (see https://tomcat.apache.org/migration-10.html#Specification_APIs).
If that doesn't fix it we'll need a sample project and installation instructions to help us replicate the problem locally.
Comment From: wilkinsona
As a guess, I suspect that you might be using an incompatible version of Tomcat
That's the problem. I can see in one of the screenshots that Tomcat 8.5.98 is being used.