fix(runtime): javac -parameters + fallback ObjectMapper bean#3
Merged
Conversation
Two runtime-only blockers found by ./gradlew :devslab-kit-sample-app:test
(compile was always green, so neither showed up earlier):
1. Spring Data JPA AOT processor (`processTestAot`) failed with
`IllegalArgumentException: MethodParameter.getParameterName() must not be null`
when trying to generate AOT code for the @Param("userId") native query on
JpaPlatformPermissionRepository.findCodesForUserId. Spring Data needs
parameter names to survive into bytecode; the default javac in our
subprojects {} convention was emitting them.
Fix: add `options.compilerArgs.add("-parameters")` to
`tasks.withType<JavaCompile>().configureEach` in the root convention.
2. ApplicationContext refresh failed with NoSuchBeanDefinitionException for
ObjectMapper, requested by `auditLogService` in AuditAutoConfiguration.
Spring Boot 4 didn't activate JacksonAutoConfiguration in our setup
(likely because spring-boot-starter-webmvc no longer pulls it transitively
the way starter-web did in 3.x). Rather than chasing the starter graph,
register a `@ConditionalOnMissingBean ObjectMapper` fallback in
AuditAutoConfiguration; consumer apps that already expose an ObjectMapper
(e.g. via Jackson autoconfig) win via the conditional.
Verified: ./gradlew :devslab-kit-sample-app:test now passes (51s):
- ApplicationContext boots cleanly
- All 8 starter beans autowire (TenantResolver, TenantContextHolder,
CurrentUserProvider, PasswordHasher, LocalLoginService,
PermissionChecker, MenuProvider, AuditEventPublisher)
- Flyway V1–V4 migrate against real Postgres (Testcontainers)
- BCrypt round-trip works
Warning still observed (non-fatal, deferred): Spring Data Redis tries to
classify our JPA repositories as RedisHash candidates because we pull in
spring-data-redis. Will silence with `spring.data.redis.repositories.enabled=false`
in a follow-up.
This was referenced May 26, 2026
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
First runtime test (
./gradlew :devslab-kit-sample-app:testagainst Testcontainers Postgres + Redis) surfaced two issues that the compile-only verification in PR #1/#2 had no way to catch.1. AOT processing failed (
processTestAot)Triggered by
JpaPlatformPermissionRepository.findCodesForUserId(@Param("userId") UUID userId). Spring Data JPA's AOT repository generator needs parameter names to survive into bytecode.Fix: add
-parametersto javac via rootsubprojects {}convention.2. ApplicationContext refresh failed
JacksonAutoConfiguration didn't activate in Spring Boot 4 with our current dependency graph (
spring-boot-starter-webmvcno longer pulls it transitively the waystarter-webdid in 3.x).Fix: register
@ConditionalOnMissingBean ObjectMapperfallback inAuditAutoConfiguration. Consumers that bring their own (Spring Boot Jackson autoconfig, custom mapper, etc.) still win via the conditional.Verified
Known non-fatal warning (deferred follow-up)
Spring Data Redis tries to classify our JPA repos as RedisHash candidates because we depend on
spring-data-redis. Will silence withspring.data.redis.repositories.enabled=falsein a later commit (planning §12 Redis usage).