Results 1 to 3 of 3

Thread: Spring Batch and PropertyPlaceholderConfigurer

  1. #1

    Default 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. #2
    Join Date
    Feb 2008
    Posts
    488

    Default

    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.

  3. #3

    Default

    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.

Tags for this Thread

Posting Permissions

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