Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In location attribute of <context:property-placeholder /> SpEL expressions are not evaulated [SPR-11072] #15699

Closed
spring-issuemaster opened this issue Nov 6, 2013 · 1 comment

Comments

@spring-issuemaster
Copy link
Collaborator

@spring-issuemaster spring-issuemaster commented Nov 6, 2013

sibidiba opened SPR-11072 and commented

Given you include an SpEL expression in the location attribute of <context:property-placeholder />, when the context is loaded, then you will get an exception implying the SpEL expression was not evaluated but taken literally. E.g.:

<context:property-placeholder local-override="true" system-properties-mode="OVERRIDE" location="classpath*:config.properties,config-#{environment['config.environment'] ? environment['config.environment'] : 'embvedded'}.properties,config-overrides.properties">
Exception in thread "main" org.springframework.beans.factory.BeanInitializationException: Could not load properties; nested exception is java.io.FileNotFoundException: class path resource [config-#{environment['config.environment'] ? environment['config.environment'] : 'config'}.properties] cannot be opened because it does not exist
	at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:87)
...

See for workaround: http://stackoverflow.com/questions/6900259/using-contextproperty-placeholder-location-with-spring-el


Affects: 3.2.4

2 votes, 1 watchers

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Jan 12, 2019

Bulk closing outdated, unresolved issues. Please, reopen if still relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.