Results 1 to 5 of 5

Thread: Problem using #{jobExecutionContext[${batchConfig.resources.sourceDatabase}]}

Threaded View

  1. #1
    Join Date
    Apr 2009
    Posts
    14

    Default Problem using #{jobExecutionContext[${batchConfig.resources.sourceDatabase}]}

    Hi,
    I am using Spring Batch 2.0.0 and try to use the late binding feture to load the data source through execution context. Here is the bean defination -

    <beans:bean id="testSRC" class="org.springframework.orm.ibatis.SqlMapClient FactoryBean">
    <beansroperty name="dataSource" value="#{jobExecutionContext[${batchConfig.resources.sourceDatabase}]}" />
    <beansroperty name="configLocation" value="ibatis-config.xml" />
    </beans:bean>

    The data source is fetched from JNDI resource and loaded in execution context with Job listener in beforeStart().

    When I run this batch I get following error -
    HTML Code:
    org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] 
    to required type [javax.sql.DataSource] for property 'dataSource'; 
    .......
    So is it means that through late binding only String can be passed?
    Last edited by vinvh; Mar 12th, 2010 at 04:10 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •