springboot启动找不到类

现象

Field transportClient in
cn.com.flashspace.wms.databus.common.es.ElasticSearchBase required a
bean of type ‘org.elasticsearch.client.transport.TransportClient’ that
could not be found.

The injection point has the following annotations:

  • @org.springframework.beans.factory.annotation.Autowired(required=true)

原因

由于扫描范围导致@ComponentScan(“cn.com.flash”)

@SpringBootApplication
@EnableDiscoveryClient
@EnableTransactionManagement
@EnableFeignClients({ "cn.com.flashspace.wms" })
@MapperScan("cn.com.flashspace.wms.databus.*.mapper")
@EnableSwagger2
@EnableAsync
@EnableScheduling
@ComponentScan("cn.com.flash")
@EnableBinding({DatabusMessagePipe.class})
public class WmsDatabusApplication {
    public static void main(String[] args) {
        SpringApplication.run(WmsDatabusApplication.class, args);
    }
}

Field transportClient in cn.com.flashspace.wms.databus.common.es.ElasticSearchBase required a bean of type ‘org.elasticsearch.client.transport.TransportClient’ that could not be found.

The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)

你可能感兴趣的:(EX)