spring-cloud / spring-cloud-openfeign

Support for using OpenFeign in Spring Cloud apps
Apache License 2.0
1.2k stars 779 forks source link

Missing reflection metadata for feign.ResponseInterceptor$Chain #959

Closed justogaiht closed 8 months ago

justogaiht commented 9 months ago

Describe the bug spring-cloud-starter-openfeign: 4.1.0

Unable to run native compiled application with FeignClients.

Caused by: org.graalvm.nativeimage.MissingReflectionRegistrationError: The program tried to reflectively invoke method public default feign.ResponseInterceptor$Chain feign.Capability.enrich(feign.ResponseInterceptor$Chain) without it being registered for runtime reflection. Add public default feign.ResponseInterceptor$Chain feign.Capability.enrich(feign.ResponseInterceptor$Chain) to the reflection metadata to solve this problem.

It works on 4.1.0-RC1.

Sample Create a simple FeignClient and run native compiled executable.

Dependencies versions

implementation platform("org.springframework.boot:spring-boot-dependencies:3.2.0")
        implementation platform("org.springframework.cloud:spring-cloud-dependencies:2023.0.0")
    implementation ('org.springframework.cloud:spring-cloud-starter-openfeign')

Workaround:

 implementation platform("org.springframework.boot:spring-boot-dependencies:3.2.0")
        implementation platform("org.springframework.cloud:spring-cloud-dependencies:2023.0.0")
    implementation ('org.springframework.cloud:spring-cloud-starter-openfeign')
    implementation ('io.github.openfeign:feign-core'){
        version{ strictly '12.5'}
    }
    implementation ('io.github.openfeign:feign-micrometer'){
        version{ strictly '12.5'}
    }
OlgaMaciaszek commented 8 months ago

Was able to reproduce when Micrometer support enabled.