[ 
https://issues.apache.org/jira/browse/CAMEL-24060?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18096232#comment-18096232
 ] 

Claus Ibsen commented on CAMEL-24060:
-------------------------------------

Fixed via https://github.com/apache/camel/pull/24683

> camel-pqc: PQCMicrometerMetrics static reference breaks GraalVM native image 
> compilation
> ----------------------------------------------------------------------------------------
>
>                 Key: CAMEL-24060
>                 URL: https://issues.apache.org/jira/browse/CAMEL-24060
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-pqc
>            Reporter: Jiří Ondrušek
>            Assignee: Jiří Ondrušek
>            Priority: Major
>             Fix For: 4.22.0
>
>
> The PQCProducer.createMetrics() method (added in CAMEL-23848) directly 
> imports and calls PQCMicrometerMetrics.create(camelContext). While there is a 
> runtime classpath guard that prevents loading the class on JVM when 
> micrometer is absent, GraalVM native image performs closed-world static 
> analysis and follows the bytecode reference to PQCMicrometerMetrics -> 
> io.micrometer.core.instrument.Meter, causing:
> {code}
> Discovered unresolved method during parsing: 
> org.apache.camel.component.pqc.metrics.PQCMicrometerMetrics.create(org.apache.camel.CamelContext)
> Caused by: java.lang.ClassNotFoundException: 
> io.micrometer.core.instrument.Meter
> {code}
> *Fix:* Replace the direct PQCMicrometerMetrics.create() call with reflection 
> via CamelContext.getClassResolver() so GraalVM never sees a static link to 
> micrometer classes.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to