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-issuemaster opened this issue Dec 7, 2018 · 3 comments
Assignees

Comments

@spring-issuemaster
Copy link
Collaborator

@spring-issuemaster spring-issuemaster 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-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster 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-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster 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-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Dec 12, 2018

Rossen Stoyanchev commented

(y)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.