Skip to content

Spring boot does not work with Tomcat 10 #22414

Description

@dimaa6

I had to change Tomcat version used with Spring boot from 9.0.36 to 10.0.0-M7. Spring boot found dependencies, I see them in class path:

C:\Users....m2\repository\org\apache\tomcat\embed\tomcat-embed-core\10.0.0-M7\tomcat-embed-core-10.0.0-M7.jar

However Tomcat initialization section is missing from the application logs, and there is no listener on configured port.

When I added @ServletComponentScan annotation to my application class, application failed to start:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'servletComponentRegisteringPostProcessor': Bean instantiation via constructor failed; nested exception is java.lang.NoClassDefFoundError: javax/servlet/annotation/WebServlet

It looks like Spring boot is not aware of javax -> jakarta change in Tomcat 10 APIs. I'm using the latest 2.3.1-RELEASE version of Spring Boot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    for: external-projectFor an external project and not something we can fixstatus: supersededAn issue that has been superseded by another

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions