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

Fix ordering of SPRING_APPLICATION_JSON property source relative to servlet property sources #17652

Closed
windmueller opened this issue Jul 26, 2019 · 1 comment
Assignees
Labels
type: bug A general bug
Milestone

Comments

@windmueller
Copy link

I am trying to override servlet context parameters included in the web.xml of a Spring Boot war file. To achieve this, I added the environment variable SPRING_APPLICATION_JSON to the setenv.sh file of my Tomcat installation.

According to the documentation, the JSON config should be evaluated first. This is not the case, the valued from the web.xml are used instead.

While debugging PropertySourcesPropertyResolver, I discovered that the list of property resolvers has a different ordering than described in the documentation:

image

Is this a bug or is there any other way to override parameters from web.xml?

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 26, 2019
@mbhave
Copy link
Contributor

mbhave commented Jul 26, 2019

It does look like there's a discrepancy between the docs and the actual behavior. The property source for SPRING_APPLICATION_JSON is ordered before jndiProperties but it doesn't seem to be doing anything about ordering it with respect to servletConfigInitParams and servletContextInitParams.

Let's see what the team thinks about what the correct behavior should be.

@mbhave mbhave added the for: team-attention An issue we'd like other members of the team to review label Jul 29, 2019
@philwebb philwebb removed for: team-attention An issue we'd like other members of the team to review status: waiting-for-triage An issue we've not yet triaged labels Jul 31, 2019
@philwebb philwebb added this to the 2.1.x milestone Jul 31, 2019
@mbhave mbhave added the type: bug A general bug label Jul 31, 2019
@mbhave mbhave self-assigned this Jul 31, 2019
@mbhave mbhave modified the milestones: 2.1.x, 2.1.7 Jul 31, 2019
@mbhave mbhave closed this as completed in 96235ea Jul 31, 2019
@mbhave mbhave changed the title SPRING_APPLICATION_JSON is evaluated too late Fix ordering of SPRING_APPLICATION_JSON property source relative to servlet property sources Jul 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

4 participants