Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

当引入spring cloud sleuth组件时,使用feign调用其他服务报错NullPointerException #1464

Open
ming697 opened this issue Nov 22, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@ming697
Copy link

ming697 commented Nov 22, 2024

Describe the bug
当引入sleuth组件时,使用feign调用其他服务报错NullPointerException

To Reproduce
org.springframework.cloud.openfeign.ribbon.FeignLoadBalancer#execute调用request.client().execute(request.toRequest(), options)时会走org.springframework.cloud.sleuth.instrument.web.client.feign.TracingFeignClient这个实现,TracingFeignClient在构建Feign.Request时没有设置RequestTemplate,EnhancedFeignClient实际执行时构建DefaultServiceInstance serviceInstance = new DefaultServiceInstance(request.requestTemplate().feignTarget().name(), url.getHost(), url.getPort(), url.getScheme().equals("https"));导致空指针

Environment

  • spring cloud tencent version: 1.13.3-Hoxton.SR12
  • spring-cloud-starter-openfeign: 2.2.2.RELEASE
  • feign-core: 10.9

Additional context
TracingFeignClient
EnhancedFeignClient

@ming697 ming697 added the bug Something isn't working label Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants