opentracing-contrib / java-spring-cloud

Distributed tracing for Spring Boot, Cloud and other Spring projects
Apache License 2.0
388 stars 143 forks source link

ExecutorBeanPostProcessor tries to create cglib proxy for class without visible constructor #289

Open kohegen opened 4 years ago

kohegen commented 4 years ago

Problem: The issue is when io.opentracing.contrib.spring.cloud.async.ExecutorBeanPostProcessor tries to create CGlib proxy on FinalizableDelegatedExecutorService and DelegatedScheduledExecutorService which don't have visible constructor. it fails with exception below:

java.lang.IllegalArgumentException: No visible constructors in class java.util.concurrent.Executors$DelegatedScheduledExecutorService

Reproduction - just try to do instrumentation for Executors below:

Executors.newSingleThreadExecutor()

or

Executors.newSingleThreadScheduledExecutor()

Tested on version:

0.5.3       

Module:

opentracing-spring-cloud-core

This is the exact same problem as here: https://github.com/spring-cloud/spring-cloud-sleuth/issues/684

pschichtel commented 4 years ago

I'm hitting this too, has there been any investigation on how to fix this?

kohegen commented 4 years ago

This is how it has been fixed in spring-cloud-sleuth: https://github.com/spring-cloud/spring-cloud-sleuth/commit/58f3d0fce000cf849f4d9674820b4da7c75d59b1