Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Question title springboot3.x FormAuthenticationFilter 还是引入的 javax 的包 #1866

Open
1 task done
sunxingxiang opened this issue Nov 7, 2024 · 4 comments
Labels

Comments

@sunxingxiang
Copy link

Search before asking

  • I had searched in the issues and found no similar issues.

Question

2.0.1v + springboot3.x FormAuthenticationFilter 还是引入的 javax 的包

@LiuYawei2019
Copy link

I also encountered the same problem. In Spring Boot 3.3.x version, the dependency on Servlets uses the Jakarta servlet-api package. Just adding the Spring Boot 3.x automatic configuration class under the META-INF/spring/ directory does not mean it is fully compatible with Spring Boot 3.x.

@lprimak
Copy link
Contributor

lprimak commented Nov 7, 2024

Have you looked at https://github.com/apache/shiro/tree/main/samples/spring-boot-3-web example?
Specifically, how the Shiro BOM is included?

That sample specifically shows how to use Spring Boot 3 with Shiro.

@sunxingxiang
Copy link
Author

Have you looked at https://github.com/apache/shiro/tree/main/samples/spring-boot-3-web example? Specifically, how the Shiro BOM is included?

That sample specifically shows how to use Spring Boot 3 with Shiro.

i run the example but error
Caused by: java.lang.NoClassDefFoundError: javax/servlet/Filter
at java.base/java.lang.Class.getDeclaredMethods0(Native Method) ~[na:na]
at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3578) ~[na:na]
at java.base/java.lang.Class.getDeclaredMethods(Class.java:2676) ~[na:na]
at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:465) ~[spring-core-6.1.13.jar:6.1.13]
... 33 common frames omitted
Caused by: java.lang.ClassNotFoundException: javax.servlet.Filter
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) ~[na:na]
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) ~[na:na]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526) ~[na:na]
... 37 common frames omitted

@fpapon
Copy link
Member

fpapon commented Nov 9, 2024

You need to use the jakarta classifier and use the BOM to exclude the non jakarta dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants