Properties using Spring @ Configuration

If I have PropertyPlaceholderConfigurergoing through an XML file, is it possible to use its Spring @Configurationas a property source for all the beans that it processes?

@Configuration
@ComponentScan(value = { "x.y.z })
@ImportResource({ "classpath:remote-properties/applicationContext.xml",})
public class CoreConfiguration implements TransactionManagementConfigurer {

    @Resource(name = "com.c.h.c.PropertyPlaceholderConfigurer")
    public PropertyPlaceholderConfigurer pp;

   @Bean
    public PropertyPlaceholderConfigurer propertiesFactoryBean() {
        return pp;
    }
}

With the above, he never hits a breakpoint on pp. If I remove the @Beanmethod, I can check what is populating pp. So how can I register it using the configuration?

+3
source share
1 answer

I feel pretty stupid. I missed the right curly brace on one of my annotations @Value. I can’t imagine how many times I looked at it and missed it.

, PropertyPlaceHolderConfigurer , @ImportResource on . @Resource.

+3

All Articles