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

WebMvcConfigurerComposite: Overridden method 'WebMvcConfigurer.addCorsMappings' never called [SPR-17580] #22112

Closed
spring-projects-issues opened this issue Dec 7, 2018 · 3 comments
Assignees
Labels
in: web status: declined

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Dec 7, 2018

Dave Cleary opened SPR-17580 and commented

Through some debugging, found that addWebMvcConfigurers is called after addCorsMappings. Because of this the overridden addCorsMappings is never called. For now my workaround is using the CorsFilter but I would rather setup in the Web Configuration.


Affects: 5.1.3

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Dec 12, 2018

Rossen Stoyanchev commented

This shouldn't be the case normally. It sounds like something is triggering early initialization of the Spring MVC infrastructure. Perhaps some class injecting and calling methods on WebMvcConfigurationSupport. Can you reproduce this in an isolated sample?

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Dec 12, 2018

Dave Cleary commented

You nailed it: Found almost immediately that I had an injected RequestMappingHandlerMapping in a config class. Was using to log some info on application startup. Simple enough to move that somewhere else.

Thanks!

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Dec 12, 2018

Rossen Stoyanchev commented

(y)

@spring-projects-issues spring-projects-issues added type: bug status: declined in: web labels Jan 11, 2019
@spring-projects-issues spring-projects-issues removed the type: bug label Jan 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web status: declined
Projects
None yet
Development

No branches or pull requests

2 participants