Skip to content

fix(build): bump springdoc to 2.8.6 for Spring Framework 6.2 compatibility - #1537

Merged
mp-orkes merged 2 commits into
mainfrom
fix/swagger-error
Aug 14, 2026
Merged

fix(build): bump springdoc to 2.8.6 for Spring Framework 6.2 compatibility#1537
mp-orkes merged 2 commits into
mainfrom
fix/swagger-error

Conversation

@mp-orkes

@mp-orkes mp-orkes commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

GET /api-docs returns 500, so Swagger UI is unusable:

NoSuchMethodError: 'void ControllerAdviceBean.<init>(java.lang.Object)'

springdoc 2.1.0 calls ControllerAdviceBean(Object), removed in Spring Framework 6.2. 8f78c0a78 bumped Spring Boot 3.3.5 → 3.5.14 (Framework 6.1 → 6.2) and left revSpringDoc at 2.1.0. It links lazily on first call, so the server starts clean and only /api-docs breaks.

Notes

  • Nothing caught this because no test had ever requested the document.
  • The test uses a local @RestControllerAdvice instead of ApplicationExceptionMapper — springdoc only needs some advice bean present, and importing the production one into a context breaks ApplicationExceptionMapperTest, which installs a JVM-wide static LoggerFactory mock into the shared Gradle test JVM.
  • kafka/build.gradle drops two unused test deps. mockserver pulls the pre-jakarta io.swagger.core.v3:swagger-core, which duplicates springdoc's swagger-core-jakarta packages and is missing ObjectMapperFactory.createJson31() — enough to break the module's Spring context under 2.8.6. Nothing in kafka/src references mockserver or testcontainers, so removing them leaves only the jakarta artifacts on the classpath.

mp-orkes and others added 2 commits August 13, 2026 19:49
…ility

GET /api-docs returned 500, breaking Swagger UI:

  NoSuchMethodError: 'void ControllerAdviceBean.<init>(java.lang.Object)'
      at GenericResponseService.lambda$getGenericMapResponse$8

springdoc 2.1.0 is built against Spring Framework 6.0 and calls
ControllerAdviceBean(Object) while walking @ControllerAdvice beans to build
the OpenAPI document. That constructor was deprecated in 6.0 and removed in
6.2. Bumping Spring Boot 3.3.5 -> 3.5.14 in 8f78c0a pulled in Spring
Framework 6.2 and left revSpringDoc at 2.1.0, so the call site no longer
resolves. It links lazily on first invocation, which is why the server starts
and every other endpoint works.

Adds a regression test that loads a context with an advice bean and requests
the document — the only thing that exercises the broken path.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
:conductor-kafka:test failed to build its Spring context under springdoc 2.8.6:

  NoSuchMethodError: 'ObjectMapper io.swagger.v3.core.util.ObjectMapperFactory.createJson31()'
      at org.springdoc.core.providers.ObjectMapperProvider.<init>

mockserver pulls io.swagger.core.v3:swagger-core 2.1.13 (pre-jakarta) via
swagger-parser. It ships the same io.swagger.v3.* packages as the
swagger-core-jakarta springdoc resolves, so whichever jar lands first on the
classpath wins, and the pre-jakarta copy lacks createJson31(). springdoc 2.1.0
never called it, so the duplicate-class conflict was latent.

Nothing in kafka/src references mockserver or testcontainers — both test
dependencies are unused, and they are the only source of the pre-jakarta
artifacts here. Removing them leaves only the jakarta ones on the classpath.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@mp-orkes
mp-orkes marked this pull request as ready for review August 13, 2026 23:54

@nthmost-orkes nthmost-orkes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get it

@mp-orkes
mp-orkes merged commit cf7c3e4 into main Aug 14, 2026
11 checks passed
@mp-orkes
mp-orkes deleted the fix/swagger-error branch August 14, 2026 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants