-
Notifications
You must be signed in to change notification settings - Fork 40.9k
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
Start up failure when creating an Aspect targeted at ServerHttpSecurity with devtools on the classpath. #19010
Comments
Thanks for the sample. The problem is caused by DevTools' split class loader and your aspect. It applies to The situation can be changed (but not really improved) by pulling
This then causes a failure as the
This is also caused by DevTools' split class loader as the code looking for the |
We wondered if pulling everything up into the restart class loader would work, albeit possibly at the expense of slightly slower restarts. It doesn't. It does allow the application to start, but it no longer restarts when changes are made. |
@wilkinsona any recommendation for how workaround that for similar cases with package protected beans in different libraries ? as i have the same case with DEV tools for spring boot 2.2.2 and if I move it to restart class loader , the main class loader will fail as it will not find it . any recommendations ? |
If the root cause of your problem is the same as the one described above then, unfortunately, there's no known workaround. |
@wilkinsona thanks for your fast response , do u know if we have any sample for spring dev tools that work with spring boot multi module project somewhere? |
@Romeh I'm not aware of one. As long as you have all of your application's modules open in your IDE, it should work without any further configuration. If some of them aren't open in your IDE, you may need to customise the restart class loader as described in the documentation. |
I am creating an aspect that adds additional behavior to
SecurityHttpSecurity
beans before the execution of theauthorize()
method inSecurityHttpSecurity
. When devtools is on the class path, the app crashes with the following error (Everything works as expected if I remove devtools from dependencies section in mybuild.gradle
file and the aspect advice is executed):Versions:
Spring boot: 2.2.1.RELEASE
Spring dependency management: 1.0.8.RELEASE
Kotlin: 1.3.50
Java: 12
Gradle: 5.6.4
Sample repo to reproduce the issue: https://github.com/Janani-Subbiah/demo
I am looking for a way to be able to add some advice to all
ServerHttpSecurity
beans, created anywhere in the app, when theauthorize()
method is called.My apologies if this has been addressed in the docs already or if this needs to posted some place else. Additionally, if this approach is incorrect, I would appreciate suggestions/recommendations on how I could achieve what I am trying to do! Thanks!
The text was updated successfully, but these errors were encountered: