Announcement Announcement Module
Collapse
No announcement yet.
Spring Batch Admin overriding PropertyPlaceholderConfigurer Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Batch Admin overriding PropertyPlaceholderConfigurer

    We are using Spring Batch admin and came across different kind of issues trying to override the PropertyPlaceholderConfigurerin env-context in spring-batch-admin-manager

    Code:
    <!--  Use this to set additional properties on beans at run time -->
    	<bean id="placeholderProperties" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    		<property name="locations">
    			<list>
    				<value>classpath:/org/springframework/batch/admin/bootstrap/batch.properties</value>
    				<value>classpath:batch-default.properties</value>
    				<value>classpath:batch-${ENVIRONMENT:hsql}.properties</value>
    			</list>
    		</property>
    		<property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
    		<property name="ignoreResourceNotFound" value="true" />
    		<property name="ignoreUnresolvablePlaceholders" value="false" />
    		<property name="order" value="1" />
    	</bean>

    we finally use this in our web-app under spring/batch/override as mentioned in the docs
    Code:
     
     <bean id="customProperties" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    		<property name="locations">
    			<list>
    				<value>file:///${app.config}/*.properties</value>
    			</list>
    		</property>
    		<property name="ignoreUnresolvablePlaceholders" value="true" />
                    <property name="ignoreResourceNotFound" value="true" />
    		<property name="order" value="0" />
    	</bean>
    was this the intended way for overriding the properties ?

  • #2
    If it works then that's good, but I guess it didn't - if not what's the problem? There are some issues with property placeholders and eager initialization (see https://jira.springsource.org/browse/BATCHADM-110). I think you have to be a bit careful with placeholders in the child contexts where Jobs are defined in Spring Batch Admin, but for the parent it should be fine. I would maybe have used an override (identical bean id), but your approach looks fine.

    Comment

    Working...
    X