context:property-placeholder doesn't resolve references

前端 未结 2 1856
故里飘歌
故里飘歌 2020-12-16 03:33

I have next applicationContext.xml file on the root of classpath:



    

        
相关标签:
2条回答
  • 2020-12-16 04:02

    I was having the same issue and came across this post but I was unable to resolve it the same way maks did. What ended up working for me was to set the ignoreUnresolvablePlaceholders property value to true.

    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="location">
            <value>classpath:database.properties</value>
        </property>
        <property name="ignoreUnresolvablePlaceholders" value="true"/>
    </bean>
    

    I am using Spring 3.2.3.RELEASE as well. I realize this post is over 4 months old but I figured someone might find it useful.

    0 讨论(0)
  • 2020-12-16 04:20

    Short form: What is the proper way to load an implementation of: BeanDefinitionRegistryPostProcessor?

    Expanded form: Is there a way to load BeanDefinitionRegistryPostProcessor before any beans have been created. If you look at the javadoc:

    Extension to the standard {@link BeanFactoryPostProcessor} SPI, allowing for the registration of further bean definitions before regular BeanFactoryPostProcessor detection kicks in.

    So it's meant to be loaded when bean definitions have been created but before any beans have been created. If we just create it as a regular bean in the application xml then it defeats the purpose of having this bean in the first place.

    0 讨论(0)
提交回复
热议问题