Field xxx required a bean of type'xxxx'that could not be found.启动失败

promise2563 2020-07-10 03:27:11
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="goods")
@RequestMapping("/sku")
public interface SkuFeign {
/**
* 查询符合条件的状态的SKU的列表
* @param status
* @return
*/
@GetMapping("/status/{status}")
public Result<List<Sku>> findByStatus(@PathVariable(name="status") String status);
}

启动类是放在了最外层的 但还是报错有大佬知道吗
...全文
1413 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
nobody-kill 2020-07-10
  • 打赏
  • 举报
回复
要把引用SkuFeign的地方贴出来

67,512

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧