Skip to content

PropertyPlaceholder does not work for @ImportResource in JavaConfig [SPR-6645] #11311

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

Closed
spring-projects-issues opened this issue Jan 5, 2010 · 5 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Jan 5, 2010

Liu, Yinwei David opened SPR-6645 and commented

PropertyPlaceholder fails to replace the placeholder in the XML Config files when they are in @ImportResource annotation of a JavaConfig.

I have one test which is a JavaConfig class and it uses @ImportResource to import one XML Config file importContext.xml, however, PropertyPlaceholder does not replace any placeholder (e.g. ${TEST}) in importContext.xml. Next, I add <import resource="importContext.xml"> in the root XML Config file, but PropertyPlaceholder still does not work. Finally, I remove @ImportResource from my JavaConfig class, and PropertyPlaceholder works.

I think it is a bug in JavaConfig. Please see my test case in the attachment.


Affects: 3.0 GA

Attachments:

Issue Links:

1 votes, 2 watchers

@spring-projects-issues
Copy link
Collaborator Author

Liu, Yinwei David commented

Attach my test case.

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Jan 31, 2010

Juergen Hoeller commented

This should have been fixed along with #11121.

Juergen

@spring-projects-issues
Copy link
Collaborator Author

Liu, Yinwei David commented

Hi Juergen,

I download the latest snapshot spring-framework-3.0.1.CI-565, however, the bug still there. If you run the test case that I attached in the jira, you can see the bean importBean still has ${TEST} as its value, and ${TEST}was not replaced by its property.

Could you please check this issue? Thanks.

David

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

David, your test works fine for me with the current HEAD version. Would be great if you could give it another try with tomorrow's 3.0.1 snapshot...

Juergen

@spring-projects-issues
Copy link
Collaborator Author

Liu, Yinwei David commented

Thanks Juergen. I tried the latest snapshot, and it works fine.

David

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants