From 0148162f2fc906ed969db5038c16ed214e04f644 Mon Sep 17 00:00:00 2001 From: marc0olo Date: Sat, 22 Aug 2026 01:28:31 +0200 Subject: [PATCH] fix: unbreak the native image builds Two regressions from #2 and #3, both only visible in a native build. The startup observer was package private. A consumer that extends BaseCache from another package - soon-market-api's ApplicationCache - gets an arc generated subclass because of @ActivateRequestContext, and that subclass cannot override a package private method across packages. Native image reports it as an unresolved method while parsing ApplicationCache_Subclass.populateCachesAtStartup and fails the build. It is public now, and fillSafely is protected for the same reason. commons-beanutils 1.11 pulls commons-logging 1.3.5 where 1.9.4 pulled 1.2, and 1.3 adds org.apache.commons.logging.impl.Log4jApiLogFactory. That class references log4j-api, which is not a dependency, and native image initialises it at build time - the processor image build fails with NoClassDefFoundError for org/apache/logging/log4j/spi/LoggerAdapter. commons-logging is pinned back to 1.2, keeping the beanutils bump and its CVE fix; the commons-logging api is unchanged between the two. Co-Authored-By: Claude Opus 5 --- pom.xml | 11 +++++++++++ src/main/java/com/kryptokrauts/shared/BaseCache.java | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 93fb182..efa0de5 100644 --- a/pom.xml +++ b/pom.xml @@ -20,6 +20,7 @@ 3.2.3 1.18.30 1.11.0 + 1.2 3.5.0 2.22 1.19.3 @@ -41,6 +42,16 @@ commons-beanutils ${beanutils.version} + + + commons-logging + commons-logging + ${commons-logging.version} + org.projectlombok lombok diff --git a/src/main/java/com/kryptokrauts/shared/BaseCache.java b/src/main/java/com/kryptokrauts/shared/BaseCache.java index 7d77dad..a4d80d9 100644 --- a/src/main/java/com/kryptokrauts/shared/BaseCache.java +++ b/src/main/java/com/kryptokrauts/shared/BaseCache.java @@ -92,7 +92,7 @@ public static Integer getTokenPrecision(String token) { * below need a Hibernate session. */ @ActivateRequestContext - void populateCachesAtStartup(@Observes StartupEvent event) { + public void populateCachesAtStartup(@Observes StartupEvent event) { long start = System.currentTimeMillis(); logger.info("Populating caches at startup"); @@ -109,7 +109,7 @@ void populateCachesAtStartup(@Observes StartupEvent event) { logger.infof("Populating caches at startup took %s ms", System.currentTimeMillis() - start); } - private void fillSafely(String name, Runnable refresh) { + protected void fillSafely(String name, Runnable refresh) { try { refresh.run(); } catch (Exception e) {