不能在spring boot quartz中使用autowired feign client

我正在使用Netflix-OSS的 Spring启动它是一个很好的微服务系统,工作正常,我正在使用Feign Client ,以便在服务和Quartz之间建立连接以运行后台作业。 但是当我在工作中使用Autowired feign-client时会出现问题。

@FeignClient(value = "user", configuration = {OAuthFeignConfig.class}, fallback = UserClientFallback.class) public interface UserClient { @RequestMapping(value = "/api/user/get/userName/{userName}", method = RequestMethod.GET) UserInfoResponse getUserInfoByUserName(@PathVariable("userName") String userName); 

和石英代码:

 public class DoJob extends RunnableTask { @Autowired private UserClient userClient; @Override public int run(JobExecutionContext jobExecutionContext) { userInfoById = userClient.getUserInfoById("123e4567-e89b-12d3-a456-426655440000"); return userinfo.getIntId(); } } 

和例外是:

 Error creating bean with name 'scopedTarget.requestData': Scope 'request' is not active for the current thread; consider defining a scoped proxy for this bean if you intend to refer to it from a singleton 

请注意,userClient对象不是null并且由Spring初始化,当我调用它的函数时,抛出exception。 WebService客户端也发生了同样的情况。 我尝试使用ApplicationContext创建Bean,但没有任何改变。 我能做什么 ??? 🙁