Skip to content
Advertisement

How to define an MS SQL datasource for use in apache camel?

I am trying to create a data source for use with the Apache camel sql component and as per the documentation I have defined the spring data source properties and included the dependencies in my pom file:

JavaScript

I have even defined a configured a data source as per numerous read examples (though if I am not mistaken, this isn’t needed if the spring default datasource properties are defined):

JavaScript

So far my efforts, all result in the same error:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'etlDataSource' defined in class path resource [com/test/camel/etl/config/DataSourceConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.sql.DataSource]: Factory method 'getDataSource' threw exception; nested exception is java.lang.IllegalStateException: No supported DataSource type found

I’d appreciate some pointers as to what I am missing.

EDIT:

My datasource properties as defined:

JavaScript

Advertisement

Answer

I solved it. I looked into the DataSourceBuilder source and saw that the build method tries to determine the type, so I specified one in the instantiation and it worked:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement