I added method-based security and added role hierarchy. I keep getting the following exception during build:
org.springf
OK, found it.
I played around with the class annotations and came to a simple solution: I removed @EnableGlobalMethodSecurity
from GlobalMethodSecurityConfig and moved it to WebSecurityConfiguration, where it was before. So it looks like this:
@Configuration
@EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled = true)
public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter { (...) }
and this:
@Configuration
public class GlobalMethodSecurityConfig extends GlobalMethodSecurityConfiguration { (...) }
The most interesting part is that the accepted answer from here advises what didn't work for me.