标签:技术 技术分享 tco service src str can http turn
由于我在项目中引用了如下代码,增加了
@Configuration
public class Connection {
public @Bean HttpClientConfig httpClientConfig() {
String connectionUrl = "http://192.168.1.13:9200";
HttpClientConfig httpClientConfig = new HttpClientConfig.Builder(connectionUrl).multiThreaded(true).build();
return httpClientConfig;
}
@Bean(name="jestClient")
public JestClient jestClient() {
JestClientFactory factory = new JestClientFactory();
return factory.getObject();
}
}
没有在项目中加入扫描的包,因此出现的这个情况,在bean中增加自动扫描的包如下:
<context:component-scan base-package="com.shanjin.oxm.service.impl,com.shanjin.oxm,com.shanjin.interceptor,com.shanjin.elasticsearch" />
org.springframework.beans.factory.BeanCreationException: Could not autowire
标签:技术 技术分享 tco service src str can http turn
原文地址:http://www.cnblogs.com/youran-he/p/7338058.html