Mind.random()

random ramblings of an eccentric programmer

Resolution : Apache Commons Configuration (XMLConfiguration) in a Spring Bean

I was trying to inject apache commons configuration (XMLConfiguration) into a Spring bean and faced the error :

hint: specify index/type/name arguments for simple parameters to avoid type ambiguities

I was breaking my head for a while only to find later that my config XML is not even in the classpath. You can find the configuration below

1
2
3
4
5
6
<bean id="xmlConfig"> <constructor-arg type="java.net.URL" value="classpath:alert-config.xml" />
<property name="reloadingStrategy"/>
</bean>

<bean id="alertConfig"> <property name="xmlConfig" ref="xmlConfig"></property>
</bean>

Comments