-
-
Notifications
You must be signed in to change notification settings - Fork 523
Exception during WebFlux tests: NoClassDefFoundError: KotlinModule$Builder #2114
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
Comments
Caused by: java.lang.NoClassDefFoundError: com/fasterxml/jackson/module/kotlin/KotlinModule$Builder |
If you have kotlin classes in your classpath see additionnal dependency you should have: Or you can disable kotlin detection: If you believe having Other issue, Provide a Minimal, Reproducible Example - with HelloController that reproduces the problem |
Edit1: Why then version 2.0.2 was working without any issue? |
@bnasslahsen Please see my latest comment ;) |
For this kind of questions, you should refer to the CHANGELOG: https://github.com/springdoc/springdoc-openapi/releases/tag/v2.0.3 You will find: #2006 - Support for nullable request parameters in Kotlin It's also clearly stated in the documentation when using kotlin with springdoc-openapi v2: NOTE: This dependency is by default transitively included with It's important to make sure you know What librairies you are loading. And what beans you need to load. The error is enough clear to guide you resolve your project dependencies issue: |
As discussed with @breun in another thread, SpringDocKotlinConfiguration is annotated for checking Kotlin classes presence. Most of the comments are for the majority related to project dependencies misconfiguration, or people not reading the documentation for v2 and sometimes people not even knowing they were shipping kotlin classes. We will consider the change of adding an extra @ConditionalOnClass(KotlinModule.Builder.class) but there will be a trade-off to accept here: Even if the projects doesn't declare jackson-module-kotlin, the application will start. And there will be no notification for people who misconfigure the kotlin module, leading sometimes to wrong beans loaded and some other times to wrong results. |
Great! Thanks. Version 2.0.4 is working as 2.0.2 without any additional properties like |
Case
Normally starting application cause NO errors at all. Everything is running smooth and well.
During tests (build or manually triggered tests) I'm getting exception:
The text was updated successfully, but these errors were encountered: