Field skuFeign in com.changgou.search.service.impl.SkuServiceImpl required a bean of type 'com.changgou.goods.feign.SkuFeign' that could not be found.
The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)
Action:
Consider defining a bean of type 'com.changgou.goods.feign.SkuFeign' in your configuration.
這個是啟動類SearchApplication
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
@EnableEurekaClient
@EnableFeignClients(basePackages = "com.changgou.goods.feign")
@EnableElasticsearchRepositories(basePackages = "com.changgou.search.dao")
public class SearchApplication {
public static void main(String[] args) {
System.setProperty("es.set.netty.runtime.available.processors", "false");
SpringApplication.run(SearchApplication.class,args);
}
}
下面的是SkuFeign
@FeignClient(value="https://bbs.csdn.net/topics/goods")
@RequestMapping("/sku")
public interface SkuFeign {
/**
* 查詢符合條件的狀態的SKU的串列
* @param status
* @return
*/
@GetMapping("/status/{status}")
public Result<List<Sku>> findByStatus(@PathVariable(name="status") String status);
}
啟動類是放在了最外層的 但還是報錯有大佬知道嗎
uj5u.com熱心網友回復:
要把參考SkuFeign的地方貼出來轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/39587.html
標籤:Java EE
上一篇:SSM框架的報錯:org.springframework.beans.factory.BeanCreationException: Error creating
