Repository navigation
Description
Native image startup fails with Redisson on Spring Boot 4.1.2 — io.netty.util.ReferenceCountUtil cannot initialize at run time
Description
Upgrading from Spring Boot 4.1.1 to 4.1.2 breaks GraalVM native image startup for an application that creates a RedissonClient through org.redisson:redisson-spring-boot-starter (RedissonAutoConfigurationV4). The failure is a run-time class-initialization error inside Netty:
java.lang.NoClassDefFoundError: Could not initialize class io.netty.util.ReferenceCountUtil
at io.netty.channel.DefaultChannelPipeline.touch(DefaultChannelPipeline.java:115)
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:784)
at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:776)
...
at org.redisson.client.RedisConnection.send(RedisConnection.java:233)
at org.redisson.client.handler.BaseConnectionHandler.initializeConnection(BaseConnectionHandler.java:116)
The redisson bean cannot establish its Redis connection, SpringApplication.run fails, and the process exits before the web server starts listening. The original ExceptionInInitializerError that first marked ReferenceCountUtil as failed is swallowed inside Netty/Redisson (it does not appear even with --logging.level.root=DEBUG), so the NoClassDefFoundError above is the first visible symptom.
The same application works on 4.1.1, and works in JVM mode on 4.1.2. Only the native image is affected.
Environment
- Spring Boot 4.1.2 (fails) / 4.1.1 (works); Spring Framework 7.0.10 / 7.0.9
- Redisson 4.8.0 with
redisson-spring-boot-starter(RedissonAutoConfigurationV4) - GraalVM CE 25.3.4.1 (Java 25) on macOS aarch64 for local reproduction; GraalVM 25.0.4 on
ubuntu-latestx86_64 in CI — both fail identically on 4.1.2 - Standard native build:
spring-boot-maven-plugin:process-aot+org.graalvm.buildtools:native-maven-plugin(add-reachability-metadata+compile-no-fork)
Steps to reproduce
A minimal @SpringBootApplication that pulls in redisson-spring-boot-starter and exposes a REST endpoint acquiring a Redisson lock, built as a native image. Reproduced in the open-source jfoundry framework's jfoundry-spring-integration-tests module:
git clone https://github.com/huahill/jfoundry.git
cd jfoundry
git checkout 2fd2191b2f7ea2366ab288f0a1337ac2d7cf4d99 # Spring Boot 4.1.2
GRAALVM_HOME=<graalvm-25> ./mvnw -pl jfoundry-runtime/jfoundry-spring/jfoundry-spring-integration-tests -am -Pnative-redisson -DskipTests verifyOr build the image and run the binary directly against any reachable Redis:
./target/jfoundry-spring-redisson-native --server.port=18080 \
--spring.data.redis.host=127.0.0.1 --spring.data.redis.port=6379On 4.1.2 startup fails with the error above; on 4.1.1 the same binary starts and the endpoint returns {"locked":true}.
Evidence that the regression comes from Spring Boot 4.1.2 itself, not Netty
Spring Boot 4.1.2 also manages Netty 4.2.19.Final (up from 4.2.17.Final in 4.1.1), so I rebuilt the identical application three times varying only these two versions:
| Spring Boot | Netty | Result |
|---|---|---|
| 4.1.1 | 4.2.17 (managed) | works — endpoint returns {"locked":true} |
| 4.1.2 | 4.2.17 (pinned via -Dnetty.version=4.2.17.Final) |
fails — same ReferenceCountUtil error |
| 4.1.2 | 4.2.19 (managed) | fails — same ReferenceCountUtil error |
Further variables ruled out:
- GraalVM version: the passing (4.1.1) and failing (4.1.2) CI runs used the same GraalVM 25.0.4.x toolchain.
- The embedded
META-INF/native-imageconfiguration insidespring-coreis byte-identical between 7.0.9 and 7.0.10. - Netty's own embedded
native-image.propertiesdelta between 4.2.17 and 4.2.19 (it addsio.netty.util.concurrent.SystemTickerto--initialize-at-run-time) is not the cause: the pinned-4.2.17 build on 4.1.2 still fails. - The class initializer itself is not inherently broken: building with
--initialize-at-build-time=io.netty.util.ReferenceCountUtilruns the static initializer successfully at image build time (the build then stops only on the expected image-heap check forio.netty.util.internal.logging.LocationAwareSlf4JLogger). Something about the class-initialization picture that Spring Boot 4.1.2 produces breaks its run-time initialization.
Expected behavior
Upgrading Spring Boot 4.1.1 → 4.1.2 should not break native image startup for Redisson-backed applications; io.netty.util.ReferenceCountUtil should initialize at run time as it does under 4.1.1.
Real-world impact
This currently blocks the jfoundry dependency-bump PR huahill/jfoundry#292, whose Spring Native Image (Redisson) CI job fails: https://github.com/huahill/jfoundry/actions/runs/39912298401/job/120422439584
Happy to attach the full startup log of the failing binary or a stripped-down reproducer project if that helps.
Activity
Tamilarasan-mac commentedon Oct 24, 2026
I would like to work on it
mhalbritter commentedon Oct 27, 2026
Hello @youngledo , please open an issue for that on the https://github.com/oracle/graalvm-reachability-metadata repository. Thanks!
youngledo commentedon Oct 27, 2026
Thanks! I've filed the follow-up with the full diagnosis here: oracle/graalvm-reachability-metadata#11228
For the record, we confirmed the failing piece comes from the metadata entries: rebuilding the identical application with the only change being
<metadataRepository><enabled>false</enabled></metadataRepository>eliminates the NettyReferenceCountUtilrun-time initialization failure (the app then only fails on an ordinary missing Tomcat reflection registration, which shows it otherwise depends on that repository's metadata). The default snapshot has no Netty 4.2.19 coverage, and Netty 4.2.17 (Spring Boot 4.1.1) — which is covered — works fine.