Error starting FIS/Spring-Boot-Application with Camel-Context having two Datasources defined
Issue
When starting a Spring-Boot-Application with a Camel-Context the following errors are getting logged:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myDataSource' defined in class path resource [spring/camel-context.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceInitializer': Invocation of init method failed; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [javax.sql.DataSource] is defined: expected single matching bean but found 2: myDataSource,myDataSource2
15:15:52.833 [main] INFO o.a.camel.spring.SpringCamelContext - Apache
In the Camel-Route there are two Datasources defined:
<bean class="org.apache.commons.dbcp.BasicDataSource" id="myDataSource">.............
<bean class="org.apache.commons.dbcp.BasicDataSource" id="myDataSource2">...........
Environment
FIS 2.0
Spring-Boot
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
