Configurationクラスのプロパティの名前は間違っていますが、Springは例外をスローしません。ログには、キーが見つからないことが示されています。
2012-06-17 05:26:49,545 DEBUG | main | o.s.core.env.PropertySourcesPropertyResolver | Could not find key 'pegaso.cfdiRequest' in any property source. Returning [null]
ConfiguratonクラスのEnvironmentクラスでプロパティを使用しています
@Configuration
@PropertySource("classpath:application.properties")
public class AppConfig {
@Autowired
Environment env;
@Bean
public FesaBean fesaBean() {
FesaBean fesaBean = new FesaBean();
fesaBean.setMyProperty(env.getProperty("pegaso.cfdiRequest"));
return fesaBean;
}
pegaso.cfdiRequestはapplication.propertiesに存在しません。それでも、例外は発生しません。