Federico Mariani created CAMEL-24057:
----------------------------------------
Summary: Undertow access log auto-configurations should check for
actually used classes in @ConditionalOnClass
Key: CAMEL-24057
URL: https://issues.apache.org/jira/browse/CAMEL-24057
Project: Camel
Issue Type: Improvement
Components: camel-spring-boot
Reporter: Federico Mariani
{{ManagementAccessLogConfiguration$UndertowAccessLogCustomizerConfiguration}}
(camel-spring-boot) and {{UndertowAccessLogConfiguration}}
(camel-platform-http-starter) are guarded by {{@ConditionalOnClass(name =
"io.undertow.Undertow")}}, but the classes directly import Undertow internals:
{code:java}
import io.undertow.server.handlers.accesslog.AccessLogHandler;
import io.undertow.server.handlers.accesslog.JBossLoggingAccessLogReceiver;
{code}
As a best practice, {{@ConditionalOnClass}} should check for the classes
actually used by the configuration, not just a top-level entry point. This
avoids {{ClassNotFoundException}} in environments where
{{io.undertow.Undertow}} is visible but internal handler classes are not
exported to the application classloader.
*Affected classes:*
-
{{o.a.c.spring.boot.actuate.accesslog.ManagementAccessLogConfiguration$UndertowAccessLogCustomizerConfiguration}}
-
{{o.a.c.component.platform.http.springboot.customizer.UndertowAccessLogConfiguration}}
Fix needed on both {{camel-spring-boot-4.18.x}} and {{main}}.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)