我正在尝试为 Hadoop/Hive 环境配置 bean。根据文档,我需要 Apache Hadoop 配置类,它应该是自动装配的。请参阅:http ://docs.spring.io/spring-hadoop/docs/2.4.0.RELEASE/reference/html/springandhadoop-store.html (第 6.2.2 节配置数据集支持)
然而,当我尝试运行我的应用程序时,我得到:NoSuchBeanDefinitionException: No qualifying bean of type [org.apache.hadoop.conf.Configuration] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency.
我的课很简单:
@SpringBootApplication
public class HiveTestApp implements CommandLineRunner {
private
@Autowired
org.apache.hadoop.conf.Configuration hadoopConfiguration;
...
我正在使用 Cloudera 集群,这里是依赖项:
dependencies {
compile(
'org.springframework.boot:spring-boot-starter-web',
'org.springframework.data:spring-data-hadoop-hive:2.4.0.RELEASE-cdh5',
'org.apache.hive:hive-jdbc:1.1.0-cdh5.4.3',
)
现在,我可能错了,但我记得过去我使用过自动装配配置,而且效果很好。最新版本有什么变化吗?我错过了什么吗?