Skip to content

Upgrade Spring Boot Admin to 4.0.0-M2 for Spring Boot 4 compatibility#508

Closed
yousfiSaad wants to merge 1 commit intospring-petclinic:mainfrom
yousfiSaad:fix/admin-server-dns-resolution
Closed

Upgrade Spring Boot Admin to 4.0.0-M2 for Spring Boot 4 compatibility#508
yousfiSaad wants to merge 1 commit intospring-petclinic:mainfrom
yousfiSaad:fix/admin-server-dns-resolution

Conversation

@yousfiSaad
Copy link
Copy Markdown

Summary

This PR fixes DNS resolution issues in Docker environments for Spring Boot Admin
when running with Spring Boot 4.

Problem

Spring Boot Admin fails to resolve container hostnames in Docker environments
due to Netty's native epoll resolver, which has issues resolving container
hostnames in Docker.

Solution

  • Upgrade Spring Boot Admin from 3.4.1 to 4.0.0-M2 for Spring Boot 4 compatibility
  • Add WebClientConfig with DefaultAddressResolverGroup to use JVM's built-in DNS
    resolver instead of Netty's native resolver

Changes

  • spring-petclinic-admin-server/pom.xml: Spring Boot Admin 3.4.1 → 4.0.0-M2
  • spring-petclinic-admin-server/src/main/java/.../admin/config/WebClientConfig.java: NEW

Related Issues

Fixes #487

@yousfiSaad
Copy link
Copy Markdown
Author

Hi @arey,

I understand your hesitation about the milestone version (4.0.0-M2). I'm not entirely convinced we should merge this as-is either - I mainly wanted to share the findings and the potential workaround.

Some context on why I created this PR:

The WebClientConfig with DefaultAddressResolverGroup is the key fix here - it resolves the Docker DNS resolution issue by using the JVM's built-in DNS resolver instead of Netty's native epoll resolver. This is a documented workaround for container hostname resolution issues.

Regarding the milestone version:

  • The WebClientConfig approach could potentially work with Spring Boot Admin 3.4.x as well
  • Upgrading to 4.0.0-M2 was primarily for Spring Boot 4 compatibility, but milestone versions do carry risk

Options moving forward:

  1. Close this PR and wait for Spring Boot Admin 4.x stable release
  2. Test the WebClientConfig fix with Spring Boot Admin 3.4.x and revert just the dependency upgrade
  3. Keep this open as a WIP/draft until Spring Boot Admin 4.0.0 is officially released

I'm open to your thoughts on the best path forward.

@arey
Copy link
Copy Markdown
Member

arey commented Feb 13, 2026

Hi @yousfiSaad, could you describe the scenario that leads to the DNS resolution issue you mentioned?
Did you find some documentation about into the Netty or Spring Boot Admin documentation?

The previous version (3.4.1) was incompatible with Spring Boot 4, causing
ClassNotFoundException: WebClientAutoConfiguration at startup.

This upgrade resolves the compatibility issue without needing any DNS
resolution workarounds.
@yousfiSaad
Copy link
Copy Markdown
Author

Update: Investigation Results

After further investigation, the original diagnosis of a "Netty DNS resolution issue" was incorrect.

What was actually wrong

The real issue was Spring Boot 4 incompatibility with Spring Boot Admin 3.4.1, which caused:

  • ClassNotFoundException: WebClientAutoConfiguration

The fix

Upgrading Spring Boot Admin from 3.4.1 to 4.0.0-M2 resolved the compatibility issue.

Why no WebClientConfig?

The originally proposed WebClientConfig class (to work around DNS resolution) was not needed because:

  • No actual DNS resolution errors (UnknownHostException) were observed
  • The default Netty behavior works correctly in Docker environments

Lesson learned

Always verify the root cause before implementing workarounds. The original symptoms were likely caused by insufficient VM memory, not DNS issues.


Note: The branch name (fix/admin-server-dns-resolution) and PR title reference DNS, but the actual fix was the SBA version upgrade for Spring Boot 4 compatibility. I'm happy to rename the branch/PR title if preferred.

@yousfiSaad yousfiSaad changed the title Fix Spring Boot Admin DNS resolution in Docker environments Upgrade Spring Boot Admin to 4.0.0-M2 for Spring Boot 4 compatibility Feb 14, 2026
@yousfiSaad yousfiSaad force-pushed the fix/admin-server-dns-resolution branch from 75a8fdd to 3c757d4 Compare February 14, 2026 17:41
@sonarqubecloud
Copy link
Copy Markdown

@arey
Copy link
Copy Markdown
Member

arey commented Mar 26, 2026

Duplicated with #513

@arey arey closed this Mar 26, 2026
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.

API Gateway Registers Unreachable/Wrong Hostname in Eureka on Windows, Causing 405 and Timeout Errors

2 participants