When I ran spring-boot-2.7, there is no issue. However when I changed code and tailored it to spring-boot-3.0, there is java.lang.ClassNotFoundException: javax.servlet.http.HttpServletRequest
Could someone help me to download the source code and run on your computer? After run it, and you click "Login using Facebook", you will see the exception. https://github.com/chuangtc/spring-boot-3.0-security-social-login
I tried adding jarkarta servlet api 6.0, but the exception is still there.
You don't have to add jakarta servlet api 6.0 into the pom.xml
.
According to documentation here, it is already included.
In your code whichever is using javax.servlet.http.HttpServletRequest
, you need to change the javax
to jakarta
.
So the whole line will be something like this:
import jakarta.servlet.http.HttpServletRequest
I faced this error before when I upgrade my service as well and I solved it using this way. Maybe you can try it.
[EDIT]
I see that one of your dependency is using the javax.servlet
:
https://mvnrepository.com/artifact/org.springframework.social/spring-social-facebook/2.0.3.RELEASE
And following this github, it seems this packages is no longer actively maintained and being archived, so it is likely they do not upgrade for Spring Boot 3.
I would recommend find other ways to work on the social login for Facebook, maybe you can try this way?
https://www.codejava.net/frameworks/spring-boot/social-login-with-facebook-example
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With