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

  • Spring Batch and PropertyPlaceholderConfigurer

    I have an application that uses Quartz to schedule jobs. This application does not use Spring Batch. It works fine.

    Now, I am considering using Spring Batch in one of the jobs that it calls. Without touching anything in the working code, I just added the Spring Batch jar in the pom.xml.

    Code:
    	<dependency>
    		<groupId>org.springframework.batch</groupId>
    		<artifactId>org.springframework.batch.core</artifactId>
    		<version>2.0.0.RELEASE</version>
    	</dependency>
    I tried deploying this and I got the following error:

    Code:
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scheduler-core-properties' defined in class path resource [spring/scheduler-context.xml]: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: Method must not be null
    This bean with the error is a PropertyPlaceholderConfigurer.

    Code:
      <bean id="scheduler-core-properties" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" lazy-init="false">
        <property name="location" value="classpath:${properties.path}/mail.properties"/>
        <property name="placeholderPrefix" value="$scheduler-core{"/> 
        <property name="placeholderSuffix" value="}"/>
      </bean>
    What is the Spring Batch jar doing that just by adding it in the library the PropertyPlaceholderConfigurer won't work? Anyone here who has encountered the same problem?

    Do I have to change the PropertyPlaceholderConfigurer settings? What if I can't change this because it is part of a general framework?

    Thanks.

  • #2
    I have seen similar things when you have conflicting versions of jars. Look through the dependencies of the your dependencies to make sure that no jars appear more than once (with differing versions). If you find some that do, then you may need to set up some exclusions in the pom to prevent conflicts.

    Comment


    • #3
      Thanks it worked.

      I remember encountering the same problem before in Spring WS when I also used the Spring repository. For some reason, that repository uses different artifact IDs that will conflict with maven repo Spring artifacts.

      Comment

      Working...
      X