Buggy code:
public class DefaultBeanDefinitionDocumentReader implements BeanDefinitionDocumentReader { public static final String BEAN_ELEMENT = BeanDefinitionParserDelegate . BEAN_ELEMENT ; public static final String NESTED_BEANS_ELEMENT = "beans" ; public static final String ALIAS_ELEMENT = "alias" ; public static final String NAME_ATTRIBUTE = "name" ; public static final String ALIAS_ATTRIBUTE = "alias" ; public static final String IMPORT_ELEMENT = "import" ; public static final String RESOURCE_ATTRIBUTE = "resource" ; public static final String PROFILE_ATTRIBUTE = "profile" ; protected final Log logger = LogFactory . getLog ( getClass ( ) ) ; private XmlReaderContext readerContext ; private Environment environment ; private BeanDefinitionParserDelegate delegate ; public void setEnvironment ( Environment environment ) { } public void registerBeanDefinitions ( Document doc , XmlReaderContext readerContext ) { } protected void doRegisterBeanDefinitions ( Element root ) { } protected BeanDefinitionParserDelegate createHelper ( XmlReaderContext readerContext , Element root , BeanDefinitionParserDelegate parentDelegate ) { } protected final XmlReaderContext getReaderContext ( ) { } protected Object extractSource ( Element ele ) { } protected void parseBeanDefinitions ( Element root , BeanDefinitionParserDelegate delegate ) { } private void parseDefaultElement ( Element ele , BeanDefinitionParserDelegate delegate ) { } protected void importBeanDefinitionResource ( Element ele ) { String location = ele . getAttribute ( DefaultBeanDefinitionDocumentReader . RESOURCE_ATTRIBUTE ) ; if ( ! ( StringUtils . hasText ( location ) ) ) { getReaderContext ( ) . error ( "Resource<seq2seq4repair_space>location<seq2seq4repair_space>must<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>empty" , ele ) ; return ; } <START_BUG> location = environment . getPropertyResolver ( ) . resolveRequiredPlaceholders ( location ) ; <END_BUG> Set < Resource > actualResources = new LinkedHashSet < Resource > ( 4 ) ; boolean absoluteLocation = false ; try { absoluteLocation = ( ResourcePatternUtils . isUrl ( location ) ) || ( ResourceUtils . toURI ( location ) . isAbsolute ( ) ) ; } catch ( URISyntaxException ex ) { } if ( absoluteLocation ) { try { int importCount = getReaderContext ( ) . getReader ( ) . loadBeanDefinitions ( location , actualResources ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( ( ( ( ( "Imported<seq2seq4repair_space>" + importCount ) + "<seq2seq4repair_space>bean<seq2seq4repair_space>definitions<seq2seq4repair_space>from<seq2seq4repair_space>URL<seq2seq4repair_space>location<seq2seq4repair_space>[" ) + location ) + "]" ) ) ; } } catch ( BeanDefinitionStoreException ex ) { getReaderContext ( ) . error ( ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>import<seq2seq4repair_space>bean<seq2seq4repair_space>definitions<seq2seq4repair_space>from<seq2seq4repair_space>URL<seq2seq4repair_space>location<seq2seq4repair_space>[" + location ) + "]" ) , ele , ex ) ; } } else { try { int importCount ; Resource relativeResource = getReaderContext ( ) . getResource ( ) . createRelative ( location ) ; if ( relativeResource . exists ( ) ) { importCount = getReaderContext ( ) . getReader ( ) . loadBeanDefinitions ( relativeResource ) ; actualResources . add ( relativeResource ) ; } else { String baseLocation = getReaderContext ( ) . getResource ( ) . getURL ( ) . toString ( ) ; importCount = getReaderContext ( ) . getReader ( ) . loadBeanDefinitions ( StringUtils . applyRelativePath ( baseLocation , location ) , actualResources ) ; } if ( logger . isDebugEnabled ( ) ) { logger . debug ( ( ( ( ( "Imported<seq2seq4repair_space>" + importCount ) + "<seq2seq4repair_space>bean<seq2seq4repair_space>definitions<seq2seq4repair_space>from<seq2seq4repair_space>relative<seq2seq4repair_space>location<seq2seq4repair_space>[" ) + location ) + "]" ) ) ; } } catch ( IOException ex ) { getReaderContext ( ) . error ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>resolve<seq2seq4repair_space>current<seq2seq4repair_space>resource<seq2seq4repair_space>location" , ele , ex ) ; } catch ( BeanDefinitionStoreException ex ) { getReaderContext ( ) . error ( ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>import<seq2seq4repair_space>bean<seq2seq4repair_space>definitions<seq2seq4repair_space>from<seq2seq4repair_space>relative<seq2seq4repair_space>location<seq2seq4repair_space>[" + location ) + "]" ) , ele , ex ) ; } } Resource [ ] actResArray = actualResources . toArray ( new Resource [ actualResources . size ( ) ] ) ; getReaderContext ( ) . fireImportProcessed ( location , actResArray , extractSource ( ele ) ) ; } protected void processAliasRegistration ( Element ele ) { } protected void processBeanDefinition ( Element ele , BeanDefinitionParserDelegate delegate ) { } protected void preProcessXml ( Element root ) { } protected void postProcessXml ( Element root ) { } }

Fix:
location = environment . resolveRequiredPlaceholders ( location ) ;