I have worked on a project using spring-batch and spring-boot.
I followed the exact rules how to integrate it by: 1. removing all @EnableBatchProcessing 2. adding ServletConfiguration and WebappConfiguration (and also import them using
@Import({ ServletConfiguration.class, WebappConfiguration.class })
add props:
batch-mysql.properties
business-schema-mysql
and modified application.properties with:
server.servletPath=/*
spring.freemarker.checkTemplateLocation=false
ENVIRONMENT=mysql
Now here is the side effect. My app is using an applicationContext .xml in addition to it's java config.
that applicationContext has some place holders:
<context:property-placeholder
location="file:///etc/location/services/myapp.properties"/>
<bean name="configuration" class="com.mycompany.commons.configuration.factory.BeanAwareConfigurationFactory">
<property name="serviceId" value="${serviceId}"/>
...
</bean>
As soon as I integrated spring-batch-admin
I got this error:
Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'serviceId' in string value "${serviceId}"
at
...
I tried @PropertySource to import it, but it didn't work:
@PropertySource("file:///etc/location/services/myapp.properties")
public class Application extends SpringBootServletInitializer {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
System.out.printf("Started processor service app");
}
As soon as I removed spring-batch-admin
from my spring-boot
project I manage to attach those props.
Any idea how to overcome this?