[
https://issues.apache.org/jira/browse/CAMEL-21460?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17899413#comment-17899413
]
Pasquale Congiusti commented on CAMEL-21460:
--------------------------------------------
This problem only exists when you're using the BOM coming from Springboot
_org.springframework.boot:spring-boot-dependencies_ (ie, when using Camel
Jbang) which is forcing the runtime dependencies to a different version than
the one required. This will be naturally fixed when the Spring Boot BOM will
align the dependencies to 1.43. In the while, the most immediate workaround is
to provide the application pom.xml with the set of dependencies we want to
force for Opentelemetry:
{code}
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-sdk</artifactId>
<version>1.43.0</version>
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-api</artifactId>
<version>1.43.0</version>
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-context</artifactId>
<version>1.43.0</version>
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-logs</artifactId>
<version>1.43.0</version>
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-metrics</artifactId>
<version>1.43.0</version>
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-sdk-common</artifactId>
<version>1.43.0</version>
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-sdk-metrics</artifactId>
<version>1.43.0</version>
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-sdk-logs</artifactId>
<version>1.43.0</version>
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-sdk-trace</artifactId>
<version>1.43.0</version>
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-api-incubator</artifactId>
<version>1.43.0-alpha</version>
</dependency>
{code}
> [camel-opentelemetry] Cannot run with Camel Springboot runtime
> --------------------------------------------------------------
>
> Key: CAMEL-21460
> URL: https://issues.apache.org/jira/browse/CAMEL-21460
> Project: Camel
> Issue Type: Bug
> Affects Versions: 4.8.1
> Reporter: Pasquale Congiusti
> Priority: Major
> Fix For: 4.9.0
>
>
> I'm testing the camel-opentelemetry component against Spring Boot runtime.
> I've followed the instructions but it seems that for some reason, the
> application can't start reporting the following error:
> {code}
> 2024-11-18T10:25:17.103+01:00 WARN 64348 --- [ main]
> ConfigServletWebServerApplicationContext : Exception encountered during
> context initialization - cancelling refresh attempt:
> org.springframework.beans.factory.UnsatisfiedDependencyException: Error
> creating bean with name 'openTelemetryEventNotifier' defined in
> org.apache.camel.opentelemetry.starter.OpenTelemetryAutoConfiguration:
> Unsatisfied dependency expressed through method 'openTelemetryEventNotifier'
> parameter 0: Error creating bean with name 'camelContext' defined in class
> path resource [org/apache/camel/spring/boot/CamelAutoConfiguration.class]:
> Failed to instantiate [org.apache.camel.CamelContext]: Factory method
> 'camelContext' threw exception with message:
> 'java.util.concurrent.ScheduledExecutorService
> io.opentelemetry.context.Context.taskWrapping(java.util.concurrent.ScheduledExecutorService)'
> 2024-11-18T10:25:17.107+01:00 INFO 64348 --- [ main]
> o.apache.catalina.core.StandardService : Stopping service [Tomcat]
> 2024-11-18T10:25:17.138+01:00 INFO 64348 --- [ main]
> .s.b.a.l.ConditionEvaluationReportLogger :
> Error starting ApplicationContext. To display the condition evaluation report
> re-run your application with 'debug' enabled.
> 2024-11-18T10:25:17.161+01:00 ERROR 64348 --- [ main]
> o.s.b.d.LoggingFailureAnalysisReporter :
> ***************************
> APPLICATION FAILED TO START
> ***************************
> Description:
> An attempt was made to call a method that does not exist. The attempt was
> made from the following location:
>
> org.apache.camel.opentelemetry.OpenTelemetryInstrumentedThreadPoolFactory.newScheduledThreadPool(OpenTelemetryInstrumentedThreadPoolFactory.java:66)
> The following method did not exist:
> 'java.util.concurrent.ScheduledExecutorService
> io.opentelemetry.context.Context.taskWrapping(java.util.concurrent.ScheduledExecutorService)'
> The calling method's class,
> org.apache.camel.opentelemetry.OpenTelemetryInstrumentedThreadPoolFactory,
> was loaded from the following location:
>
> jar:nested:/home/squake/Desktop/jbangdocker/csb/target/test-1.0-SNAPSHOT.jar/!BOOT-INF/lib/camel-opentelemetry-4.8.1.jar!/org/apache/camel/opentelemetry/OpenTelemetryInstrumentedThreadPoolFactory.class
> The called method's class, io.opentelemetry.context.Context, is available
> from the following locations:
>
> jar:nested:/home/squake/Desktop/jbangdocker/csb/target/test-1.0-SNAPSHOT.jar/!BOOT-INF/lib/opentelemetry-context-1.37.0.jar!/io/opentelemetry/context/Context.class
> The called method's class hierarchy was loaded from the following locations:
> io.opentelemetry.context.Context:
> jar:nested:/home/squake/Desktop/jbangdocker/csb/target/test-1.0-SNAPSHOT.jar/!BOOT-INF/lib/opentelemetry-context-1.37.0.jar!/
> Action:
> Correct the classpath of your application so that it contains compatible
> versions of the classes
> org.apache.camel.opentelemetry.OpenTelemetryInstrumentedThreadPoolFactory and
> io.opentelemetry.context.Context
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)