-
Notifications
You must be signed in to change notification settings - Fork 40.4k
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
Strage behaviour in DelegatingWebMvcConfiguration with 1.3.0.M5 #4154
Comments
I would expect autowired methods to get called before Perhaps you could add some breakpoints to those methods and attach details of the call stack? That might give us some clues. |
BTW is this something that you see behaving differently between 1.3.0.M5 and 1.2.6? |
Thanks for the hint. I now tried 1.2.6.RELEASE (with default spring.version 4.1.7 and with spring.version 4.2.1) and I get exactly the same behavior: frist I already got breakpoints in both methods, but there's some I now just ran the not-working version with Boot 1.3.0.M5 and here is what I could copy from Eclipse debugger:
If I can give you any better information, please tell me. Sadly I can't share the project. If you can't get any useful information from the Stacks, I think I'm gonna remove classes one by one till it's working as expected, and then should be able to share a stripped down project that shows the misbehavior. |
I think something is causing early instantiation of Can you work up the stacktrace from |
This sounds like there's some problem with the |
It wasn't the dependency. Though I just spent the last 3 hours with deleting code and starting and stopping the application 😆 |
Here's the code: http://pastebin.com/JcU5Y5vL I added two break points within Additionally I added a simple Within the code I made two comments: As a workaround I can use of course Thanks in advance! |
It appears that the SpEL expression is from Spring Security. The One such bean is |
Update SecurityFilterAutoConfiguration to use a DelegatingFilterProxy filter rather directly referencing the springSecurityFilterChain bean. Using a DelegatingFilterProxy helps to prevent early initialization of beans and makes Spring Security work in a similar to way to if were installed in a regular WAR deployment. Fixes gh-4154
@benneq Can you try the latest |
Update SecurityFilterAutoConfiguration to use a DelegatingFilterProxy filter rather directly referencing the springSecurityFilterChain bean. Using a DelegatingFilterProxy helps to prevent early initialization of beans and makes Spring Security work in a similar to way to if were installed in a regular WAR deployment. Fixes spring-projectsgh-4154
@philwebb I was able to try the latest SNAPSHOT and can confirm your changes resolved this issue for me. |
Ah sorry, haven't seen your question. But I'm glad that this bug will be gone in 1.3.0.RC1 👍 |
Tested it with 1.3.0.RC1 and it works! Thank you! |
@benneq Thanks for testing |
Hi, I've got a strange problem with
DelegatingWebMvcConfiguration
:When I start our project without Spring Security (
@SpringBootApplication(exclude=org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration.class)
), everything is normal.But when I enable Spring Security (by removing the exclude), I figured out, that
DelegatingWebMvcConfiguration
's@Autowired(required = false) public void setConfigurers(List<WebMvcConfigurer> configurers)
method is getting called AFTER itsprotected void addFormatters(FormatterRegistry registry)
method.I can't figure out why this is happening. I tried to setup an extremely small test project, but there everything works as expected. I thought that
@Autowired setters
get called immediately after the constructor and before any other method can be invoked?Thanks for your help.
The text was updated successfully, but these errors were encountered: