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

<util:properties> tag doesn't let Spring EL translate script in location attribute [SPR-12482] #17088

Closed
spring-projects-issues opened this issue Nov 28, 2014 · 2 comments
Assignees
Labels
in: core status: duplicate
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Nov 28, 2014

Adam Hardy opened SPR-12482 and commented

This doesn't translate the #{systemEnvironment[]} scriptlet into the directory given in the system variable:

<util:properties id="imapExtra" location="file:#{systemEnvironment['ECNETL_PROPS']}/imap-extra.properties" />

"systemEnvironment[..." causes a file not found IOException.

But this does:

<bean id="imapExtra" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="location" value="file:#{systemEnvironment['ECNETL_PROPS']}/imap-extra.properties" />
</bean>

Here's the exception:

2014-11-28 15:14:42 INFO org.springframework.beans.factory.config.PropertiesFactoryBean.loadProperties():172 - Loading properties file from URL [file:#{systemEnvironment['ECNETL_PROPS']}/imap-extra.properties]
java.io.FileNotFoundException: (The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:146)
at java.io.FileInputStream.<init>(FileInputStream.java:101)
at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
at org.springframework.core.io.UrlResource.getInputStream(UrlResource.java:168)
at org.springframework.core.io.support.EncodedResource.getInputStream(EncodedResource.java:143)
at org.springframework.core.io.support.PropertiesLoaderUtils.fillProperties(PropertiesLoaderUtils.java:98)
at org.springframework.core.io.support.PropertiesLoaderSupport.loadProperties(PropertiesLoaderSupport.java:175)
at org.springframework.core.io.support.PropertiesLoaderSupport.mergeProperties(PropertiesLoaderSupport.java:156)
at org.springframework.beans.factory.config.PropertiesFactoryBean.createProperties(PropertiesFactoryBean.java:102)
at org.springframework.beans.factory.config.PropertiesFactoryBean.afterPropertiesSet(PropertiesFactoryBean.java:71)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1627)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1564)
... 21 more


Affects: 4.1.1

Issue Links:

  • #16999 Regression: util:properties location attribute does not resolve parameters in #{param} format ("duplicates")
@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Nov 28, 2014

Juergen Hoeller commented

This is a duplicate of #16999. The regression has been fixed in 4.1.2 already.

Juergen

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Nov 28, 2014

Adam Hardy commented

OK great.

I search on "util properties" and I got zero hits. Maybe it's the < > symbols.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core status: duplicate
Projects
None yet
Development

No branches or pull requests

2 participants