问题以及分析:
redis和hbase的xml的配置文件要分别读取不同的properties文件以获取配置信息,但是
Spring容器采用反射扫描的发现机制,在探测到Spring容器中有一个org.springframework.beans.factory.config.PropertyPlaceholderConfi
而这个基于命名空间的配置,其实内部就是创建一个PropertyPlaceholderConfi
解决办法:
不再用<context:property-placeholder location="file:/opt/search/resourse/ps_redis.properties"/>这种方式,使用
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="fileEncoding" value="UTF-8" />
<property name="locations">
<list>
<value>file:/opt/search/resourse/hbase.properties</value>
<value>file:/opt/search/resourse/ps_redis.properties</value>
</list>
</property>
</bean>
<!-- Redis配置 -->
<import resource="/redis.xml" />
<!-- Hbase配置 -->
<import resource="classpath:/spring-hbase.xml" />