I am having some trouble getting a data source setup using Camel properties
component.
So, I have a db.properties that contains configuration for my datasource
(showing only url for brevity)
My route builder seems to be able to resolve the property, but the data
source does not seem to do so.
The evidence for this is shown in the console output below.
I wonder could anyone shed some light to why this could be happening?


db.properties
        datasource.stg.url=jdbc:oracle:thin:...

camel-context.xml
        ...
        <bean id="properties"
class="org.apache.camel.component.properties.PropertiesComponent"> 
                <property name="location" value="classpath:db.properties"/>
        </bean>

        <bean id="auditDataSourceStg"
class="org.apache.commons.dbcp.BasicDataSource">
                <property name="driverClassName" 
value="oracle.jdbc.driver.OracleDriver"/>
                <property name="url" value="{{datasource.stg.url}}"/>
                <property name="username" value="{{datasource.stg.username}}"/>
                <property name="password" value="{{datasource.stg.password}}"/>
                <property name="initialSize" value="5" />
                <property name="maxActive" value="10" />
        </bean>
        ...

MyRouteBuilder.java
        ...
            public void configure() {
                from(fromQueryBuilder)
                .log("[queryyBuilder] url:{{datasource.stg.url}}")

Console output
        2013-11-16 13:20:15,609 [queryBuilder] INFO  route1                     
   
- [queryBuilder] url:jdbc:oracle:thin:...
        Cannot create JDBC driver of class 'oracle.jdbc.driver.OracleDriver' for
connect URL '{{datasource.stg.url}}'




--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-properties-component-not-being-resolved-when-configuring-data-source-tp5743375.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to