Skip to content

Question about PropertySourcesPlaceholderConfigurer Bean in JdbcHttpSession #775

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
sayan-chaliha opened this issue May 6, 2017 · 5 comments
Assignees
Labels
for: stack-overflow A question that's better suited to stackoverflow.com

Comments

@sayan-chaliha
Copy link

Hey,

I'm looking at https://github.com/spring-projects/spring-session/blob/master/spring-session/src/main/java/org/springframework/session/jdbc/config/annotation/web/http/JdbcHttpSessionConfiguration.java#L192

This bean definition here is messing up placeholder resolution in my application. Is it really necessary?

@vpavic vpavic self-assigned this May 8, 2017
@vpavic vpavic added the for: stack-overflow A question that's better suited to stackoverflow.com label May 8, 2017
@vpavic
Copy link
Contributor

vpavic commented May 8, 2017

Hi @sayan-chaliha - this was introduced while addressing #616 (see also #621 and 5ecf390).

Can you explain in more detail how is it messing up placeholder resolution in your app? Sample app would also be nice to have.

@vpavic vpavic added the status: waiting-for-feedback We need additional information before we can continue label May 8, 2017
@sayan-chaliha
Copy link
Author

Hey @vpavic -- thanks for the pointers! I'll go through them.

I'll need some time before I can get a sample working for you. The libraries I'm using are internal to the company I'm working for. Briefly though, the company has it's own infrastructure for file based configuration of applications (which is injected based on the environment the app is deployed to). The library class in question extends PropertyPlaceholderConfigurer. On instantiating a bean of this library class, I expect that all placeholders are resolved by it. However, randomly (on some environments) https://github.com/spring-projects/spring-session/blob/master/spring-session/src/main/java/org/springframework/session/jdbc/config/annotation/web/http/JdbcHttpSessionConfiguration.java#L192 gets instantiated first and doesn't resolve any of the configuration placeholders that I define.

Would it be possible to ignore placeholders it cannot resolve so that another resolver can kick in?

@vpavic
Copy link
Contributor

vpavic commented Sep 9, 2017

@sayan-chaliha Could you use the same workaround as suggested in #867 (comment)?

Can you attempt to override the PropertySourcesPlaceholderConfigurer provided by Spring Session configuration by assigning the propertySourcesPlaceholderConfigurer id to your PropertySourcesPlaceholderConfigurer bean?

@sayan-chaliha
Copy link
Author

sayan-chaliha commented Sep 10, 2017 via email

@vpavic vpavic removed the status: waiting-for-feedback We need additional information before we can continue label Sep 10, 2017
@vpavic
Copy link
Contributor

vpavic commented Oct 26, 2017

@sayan-chaliha There are proposed changes to Spring Session JDBC configuration which would eliminate the need for having PropertySourcesPlaceholderConfigurer bean registered. You can track that effort in #907.

@vpavic vpavic closed this as completed Oct 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: stack-overflow A question that's better suited to stackoverflow.com
Projects
None yet
Development

No branches or pull requests

2 participants