top of page
Writer's picturejinagamvasubabu

Spring boot3: Use jetty instead of tomcat

Updated: Jan 2


Issue:

I understand that Spring Boot 3 is currently in high demand in the market, and many applications are eager to migrate to it, which is indeed a positive trend. However, it's crucial to be aware that there are some significant changes that may pose challenges. I recently encountered a similar issue when attempting to use Jetty instead of Tomcat.


Error:


java.lang.ClassNotFoundException: jakarta.servlet.http.HttpSessionContext with Spring Boot 3 and Jetty server


Solution:

Upon investigation, I found that Spring Boot 3 requires the inclusion of several additional libraries in the project's `pom.xml` file. These libraries are listed below:



<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-jetty</artifactId>
</dependency>
<dependency>
    <groupId>jakarta.servlet</groupId>
    <artifactId>jakarta.servlet-api</artifactId>
    <version>6.0.0</version>
</dependency>
<dependency>
    <groupId>org.eclipse.jetty</groupId>
    <artifactId>jetty-server</artifactId>
    <version>11.0.14</version>
</dependency>


Please let me know in the comments section if the above solution doesn't work for you and thanks for checking out my site







189 views0 comments

Recent Posts

See All

Yorumlar


DSC_0719_edited.jpg

Vasu Jinagam

Hi 👋 , Myself Vasu Jinagam from Bengaluru India and I am currently working at slice as an Engineering Manager.

 

HangoutDude is a No-Nonsense Tech and story blog, I like to talk about Golang, Java, Distributed Microservices, Opensource and Cloud computing

You can reach out to me @ jinagamvasubabu@gmail.com

bottom of page