Results 1 to 4 of 4

Thread: Unable to load properties file in spring batch admin application

  1. #1
    Join Date
    May 2010
    Posts
    11

    Default Unable to load properties file in spring batch admin application

    Hi,

    I deployed Spring batch admin web application in tomcat. It works fine with the default jobs provided. I added a new xml file with my jobs and some of the beans specified in the XML have placeholders configured. I am using the following code to load the properties file

    <bean class="org.springframework.beans.factory.config.Pr opertyPlaceholderConfigurer" id="ocaPlaceholderConfig">
    <property name="location" value="file:/Projects/GHJ/POC/Spring-batch/config/environment_ghj.properties"></property>
    <property name="ignoreUnresolvablePlaceholders" value="true" />
    </bean>

    The property file doesnt seem to get loaded at all. I get an error while loading the beans which have the placeholders saying "Could not resolve placeholder 'sys.queue.name'". I dont see any log saying that the property file is getting loaded.

    But I see that the property file required to load the HSQL database is getting loaded without any issues(batch-hsql.properties).

    Are there any filters configured in the spring batch admin application to only load a specific set of properties file?

    Appreciate your help on this.

  2. #2
    Join Date
    Jun 2005
    Posts
    4,230

    Default

    Maybe you need to add an order property (low number) to force your placeholders to be loaded first?

  3. #3
    Join Date
    May 2010
    Posts
    11

    Default Issue with ignoreUnresolvablePlaceholders

    Thanks for your response Dave!

    In env-context.xml the load order is set to 1. I am not sure if we can set anything less than that value.

    I guess the issue is with ignoreUnresolvablePlaceholders property for a PropertyPlaceholderConfigurer. I set the ignoreUnresolvablePlaceholders property of the PropertyPlaceholderConfigurer in env-context.xml to true and I could get my property file loaded successfully.

  4. #4

    Default

    Thanks for the post. I ran into the exact issue and i had to do what you did. Should this property be set to true by default so that the child context will load without any issue?

Posting Permissions

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