Results 1 to 2 of 2

Thread: Unable to init PropertyPlaceholderConfigurer before CustomEditorConfigurer

  1. #1

    Default Unable to init PropertyPlaceholderConfigurer before CustomEditorConfigurer

    I've recently added a CustomEditorConfigurer configuration to my ApplicationContext config. After doing so, my ApplicationContext fails to initialize becuase it "Cannot load JDBC driver class '${jdbc.driverClassName}'". This tells me that the CustomEditorConfigurer is being initialized before the PropertyPlaceholderConfigurer. I've tried setting an order on CustomEditorConfigurer (2147483647) and an order on PropertyPlaceholderConfigurer (-2147483648), but still no luck.

    The PropertyEditor configured by the CustomEditorConfigurer uses a Service wired to a HibernateDao, thus requiring LocalSessionFactoryBean, and DataSource to be initialized.

    If I removed the CustomEditorConfigurer bean declaration, or hard code my jdbc params for my dataSource instead of using the placeholders, everything works fine. I'm using Spring 2.0.6.

    This seems to be the same unresolved issue from this thread:
    http://forum.springframework.org/sho...t=37820&page=2

    Code:
    <bean id="propertyConfigurer"
        class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="locations">
            <list>
                <value>classpath:/jdbc.properties</value>
                <value>classpath:/mail.properties</value>
                <value>classpath:/application.properties</value>
            </list>
        </property>
        <property name="order" value="-2147483648"/>
    </bean>
    
    <bean lazy-init="true" id="customEditorConfigurer" class="org.springframework.beans.factory.config.CustomEditorConfigurer">
        <property name="order" value="2147483647"/>
        <property name="customEditors">
            <map>
                <entry key="com.foo.domain.ListingType">
                    <bean id="genericEditor" class="com.foo.editor.AbstractDynamicEnumEditor">
                        <property name="genericLoaderService" ref="genericLoaderService" />
                    </bean>
                </entry>
            </map>
        </property>
    </bean>

  2. #2
    Join Date
    Aug 2006
    Location
    Now Germany, previously Ukraine
    Posts
    1,546

    Default

    Have you tried depends-on attribute?

    Code:
    <bean lazy-init="true" id="customEditorConfigurer" class="org.springframework.beans.factory.config.CustomEditorConfigurer"
     depends-on="propertyConfigurer">
    .............
    </bean>

Posting Permissions

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